4 ms·
non-clickbait title: Python: Mistyping a character in your code can bite you. Any IDE or linter worth its salt would catch this for you.
by orf 8y ago
non-clickbait title: Python: Mistyping a character in your code can bite you.
Any IDE or linter worth its salt would catch this for you.
- lukeschlather 8y agoCan you recommend a particular linter? I use flake8, which does not warn for this. I just tested pylint which also does not appear to warn for this.
- heavenlyblue 8y agoPyCharm would highlight the expression after : as a type that was not imported correctly (or an expression that is not a type). I would assume mypy would cause an error.
- lukeschlather 8y agoIf I wrap it in a function, mypy doesn't throw an error. I'm not sure if mypy has a function to lint such code without executing it.