News for hackers. Stuff that matters.
Re:Free-threaded CPython is ready to experiment with by simonw on Friday July 12, 2024 @06:55PM (#40950201)
This was the thing that started to bring me around to optional typing as well. It makes the most sense to me as a form of documentation - it's really useful to know what types are expected (and returned) by a Python function!

If that's baked into the code itself, your text editor can show inline information - which saves you from having to go and look at the documentation yourself.

I've started trying to add types to my libraries that expose a public API now. I think it's worth the extra effort just for the documentation benefit it provides.

Re:Free-threaded CPython is ready to experiment with by hot_gril on Friday July 12, 2024 @06:59PM (#40950222)
This is what made me give it a shot in TS, but the problem is your types at interface boundaries tend to be annoyingly complex. The other problem is any project with optional types soon becomes a project with required types everywhere.

There might be more merit in widely-used public libraries, though. I don't make those.