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
Post a Comment