News for hackers. Stuff that matters.
Re:Reasons Python Sucks by bakery2k on Tuesday December 18, 2018 @03:29PM (#18710244)
There doesn't seem to be any interest in checking type annotations at run-time. Unfortunately, without doing so, type annotations look authoritative but are essentially just comments.

I believe Julia is an example of a dynamically-typed language which does perform such checks at run-time - including as part of its support for multiple dispatch.

Re:Reasons Python Sucks by qquark on Tuesday December 18, 2018 @09:22PM (#18712508)
I've been using enforce for this purpose (https://github.com/RussBaz/enforce). It provides decorators that enable type checking where wanted. This gives the advantage of migrating existing code to type checking at your own pace at least.

On a general note I've come across a few cases, when pushing python's type annotations to their limits, that force you to put the type names in string quotes, and that makes the whole thing feel like a hack. It's better than nothing for my use cases, but if I remember correctly both mypy and enforce have problems in common that are probably coming from the way python itself is built, such as self reference in a class definition.

Re:Reasons Python Sucks by quodlibetor on Tuesday December 18, 2018 @11:40PM (#18713051)
> I've come across a few cases, when pushing python's type annotations to their limits, that force you to put the type names in string quotes

With pep-0563, python3.7, and `from __future__ import annotations` this should no longer be necessary. Those are some pretty detailed caveats, but I have been using it in places where I can and it is so nice.

Re:Reasons Python Sucks by ric2b on Friday December 21, 2018 @12:40PM (#18734909)
Python has a "we're all adults here" mindset, which means it will allow you to reach into internals of libraries, ignore type hints, etc because maybe you actually know what you're doing and know the drawbacks but just need a quick solution (lots of python code is small throwaway scripts).

For actual projects you can use a static type checker like mypy.

Re:Reasons Python Sucks by nitely on Tuesday December 18, 2018 @07:09PM (#18711830)
Make mypy type checking part of the CI pipeline. Done.