The Python Oracle

Python `if x is not None` or `if not x is None`?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Realization

--

Chapters
00:00 Question
00:39 Accepted answer (Score 1239)
01:13 Answer 2 (Score 390)
02:45 Answer 3 (Score 140)
03:05 Answer 4 (Score 42)
05:10 Thank you

--

Full question
https://stackoverflow.com/questions/2710...

Question links:
[style guide]: https://google.github.io/styleguide/pygu...
[PEP-8]: https://www.python.org/dev/peps/pep-0008...

Answer 1 links:
[Python]: http://www.python.org/dev/peps/pep-0008/...
[Truth Value Testing]: http://docs.python.org/library/stdtypes....

Answer 3 links:
[binds more weakly]: https://docs.python.org/2/reference/expr...
[documentation]: https://docs.python.org/2/reference/expr...
[grammar]: https://docs.python.org/2/reference/gram...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #codingstyle #nonetype #booleanexpression #pep8

#avk47