Pythonic emptiness checking
gruszczy at gmail.com
Wed Apr 29 15:37:13 CEST 2009
One of the Python Zen rules is Explicit is better implicit. And yet
it's ok to do:
when x is string or list. Since it's very comfy, I've got nothing
against though. I am just curious, why is it so?
And one more thing: is it ok to do
if x is not None:
Because I often encounter it and would like to know, if I can simplify
it. Especially that I liked similar construction in C/C++.
More information about the Python-list