5 ms·
Landing in a large-ish python project without type annotations is a pain. Author says that he won't use type annotations because they "can be wrong", well, you
by dgan 4y ago
Landing in a large-ish python project without type annotations is a pain. Author says that he won't use type annotations because they "can be wrong", well, you only rely on variables names and documentation for that, you have even less chance to get that right.
Is that "line" variable a "LineInvoice" or "InvoiceLine" (yes, two different classes) ? Oh, right, both can be used in this place exclusively because one is subset of the other... sigh
- CrLf 4y agoPython's base philosophy is duck typing. Whenever I read complaints like this the root cause is almost always trying to turn Python into something that it isn't instead of embracing what it is (if this isn't feasible, then Python is the wrong choice). Programming in Python worrying about types instead of behavior reminds me of the quote "you can write FORTRAN in any language".
- dgan 4y agoWell, the problem is more often than not, I am an employee. I won't come to a company and tell them "you have been using that wrong". So while correct, your statement is void of any actionable advise