4 ms·
Not argument and return types. When conventions are followed they do exactly that, actually. And unless the code is a complete trainwreck, it's pretty easy to
by vanusa 5y ago
Not argument and return types.
When conventions are followed they do exactly that, actually. And unless the code is a complete trainwreck, it's pretty easy to tell what the return type is, even without explicit annotation in the docstring.
- duped 5y agoWhat conventions are those, besides Hungarian notation (which I don't think I've ever seen in Python)?
- vanusa 5y agoPEP 257, and local conventions in certain projects. What all comes down to is: if you really have people on your project writing code like the foo/bar/baz example way up above - then you have problems way bigger than static type checks can possibly help you with.
- duped 5y agoWouldn't it be something if there existed tooling that enforced this level of discipline and checked its validity before executing any code such that you didn't rely on the entire ecosystem to adhere to the same standards and remove that as a source of ambiguity...
- vanusa 5y agoWhich Python has had since 3.5.