News for hackers. Stuff that matters.
Re:Free-threaded CPython is ready to experiment with by quotemstr on Friday July 12, 2024 @11:48PM (#40951616)
> In practice it’s quite usable

It would be super helpful if the interpreter had a type-enforcing mode though. All the various external runtime enforcement packages leave something to be desired.

Re:Free-threaded CPython is ready to experiment with by setopt on Saturday July 13, 2024 @06:35AM (#40953151)
I agree. There are usable third-party runtime type checkers though. I like Beartype, which lets you add a decorator @beartype above any function or method, and it’ll complain at runtime if arguments or return values violate the type hints.

I think runtime type checking is in some ways a better fit for a highly dynamic language like Python than static type checking, although both are useful.