Closed GuyHoozdis closed 8 years ago
great, thanks @GuyHoozdis !
The Little Book of Python Anti-Patterns is a wonderful resource. It was my pleasure to read and to make this minor contribution. Hopefully, I will be able to contribute more in the future.
Until then...
A linter would yeild an error on the anti-pattern code. Even though it is anti-pattern code, it should demonstrate best practices for everything except the anti-pattern being demonstrated.
Although
not 'k' in d
and'k' not in d
ultimately produce the same bytecode, the former is actually two operations and must be optimized to produce identical bytecode to the latter.The preferred syntax would be
'k' not in d
- per the pep8/flake8 linter.References: