4 ms·
Python has a better static typesystem than Go does: https://mypy.readthedocs.io/en/stable/kinds_of_types.html#union-types https://mypy.readthedocs.io/en/stable
by frou_dh 6y ago
Python has a better static typesystem than Go does:
https://mypy.readthedocs.io/en/stable/kinds_of_types.html#union-types https://mypy.readthedocs.io/en/stable/kinds_of_types.html#un...
https://mypy.readthedocs.io/en/stable/kinds_of_types.html#optional-types-and-the-none-type https://mypy.readthedocs.io/en/stable/kinds_of_types.html#op...
https://mypy.readthedocs.io/en/stable/generics.html https://mypy.readthedocs.io/en/stable/generics.html
https://mypy.readthedocs.io/en/stable/protocols.html https://mypy.readthedocs.io/en/stable/protocols.html
- ianamartin 6y agoEven though I like Python a lot, I clicked on a reply to this comment because I was absolutely certain I was going to have to disagree with you. That just didn't seem possible. But . . . I was wrong. That third link with generics makes me cry when I think about the go code I've written.
- searchableguy 6y agoAre those tears result of overflowing with joy or sadness?
- ianamartin 6y agoCan it be both?
- StavrosK 6y agoI'm really liking Python static types to the point where I don't write new programs without them. Give them a shot, they really help.
- karatestomp 6y agoDo most libraries use static types? Or have something widely-used and well-supported available like the @types project for TypeScript to provide them, fairly seamlessly, to consumers of those libraries?
- StavrosK 6y agoSome projects do, yes. Django, for example, has a library to provide types. In my experience, types are useful even just in my own application, since the libraries I use tend to generally only accept simple/fundamental types anyway. Things could definitely be better when it comes to library type support, though, I agree.
- enomad 6y agoWho will win: Obsoleted garbage without code blocks, lambdas, if-expressions, pattern-matching, speed, kids thinking they're metaprogramming/fp gurus. vs Garbage dumber than C without generics, error handling, sadistic linter with unused variable-error, kids thinking they're programmers. PS: of course python's type system better than Go, b/c anything is better than nothing. Moveover, python's type system has nothing common with python: sumtypes is useless without pattern matching and they doesn't play well with classes, scope-leaking variables isn't really static. I believe there will be modern high-level programming language someday. RIIR!