4 ms·
Here's a better list. * Performance is very bad. * Misspelling a variable creates a new one. * __init__ is a really terrible name for the constructor. * Typ
by ErikCorry 4y ago
Here's a better list.
* Performance is very bad.
* Misspelling a variable creates a new one.
* __init__ is a really terrible name for the constructor.
* Type annotations are ignored, so nobody bothers.
- 323 4y ago> Misspelling a variable creates a new one. IDEs/linters help with this one. > Type annotations are ignored, so nobody bothers If one really cares you can use MyPy to force errors on bad types. Type annotations are very useful for IDEs, which is why they are spreading fast in the ecosystem.
- mjr00 4y ago> * Type annotations are ignored, so nobody bothers. For any serious Python app worked on by multiple people, you need a CI pipeline that runs type checking. (And while you're there, run a format checker like black, too -- solves the tabs vs spaces "debate" the author complains about as well) Certainly still a language flaw that it's not inherently enforced, though; unfortunately it just took the Python community way too long to realize how important strong typing is at scale.
- raymondh 4y agoIndeed, this list is better.
- aYsY4dDQ2NrcNzA 4y agoYou probably already know that __init__() isn’t a constructor, technically; it’s an initializer.