python - Most succinct/low-hassle trick for identity comparison with None? -


this question frivolous consider quality-of-life/python trivia issue.

i find myself writing x not none often. there clever semantically equivalent way of writing more succinctly? or example of "only 1 way" maxim in action?

pep 20, the zen of python

there should one--and preferably one--obvious way it.

if knows magic, great. and if have tried , failed figure out, let counted.

no, there no more succinct way make comparison using is operator.


Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -