News for hackers. Stuff that matters.
Re:Python Is Eating the World by batbomb on Monday August 12, 2019 @11:13AM (#20676136)
okay, so use type annotations and mypy --strict
Re:Python Is Eating the World by CydeWeys on Monday August 12, 2019 @11:48AM (#20676509)
It's not my project; I'm just a collaborator. My experience has been that a very tiny minority of Python code out there is written in this style, so unless you're only starting projects from scratch, you can't benefit from it.
Re:Python Is Eating the World by batbomb on Monday August 12, 2019 @11:59AM (#20676640)
you can gradually type (probably don't use --strict in that case). It might not be a ton of benefit if you aren't actually writing new code though.

There's a good document on this:

https://mypy.readthedocs.io/en/latest/existing_code.html

Re:Python Is Eating the World by CydeWeys on Monday August 12, 2019 @01:33PM (#20677760)
And that'd be fine if everyone were on board with it and that were the general direction of the project, but I don't think that's true.

I've never seen a strict, type-annotated Python project out there in the wild, and I've seen a decent amount of them. A random non-primary-contributor isn't going to have much luck stepping into an established project and getting everyone to go along with adding annotations to the whole thing.

And if I were starting a project from scratch, rather than coercing the language to do something it wasn't really designed for, I'd just use a language that has first-class support for types directly in the compiler, like Java or Go.

Re:Python Is Eating the World by totalperspectiv on Monday August 12, 2019 @12:31PM (#20676995)
But at that point why not get something for they time you spend adding types and just use a different language?