I like using the is None test for empty variables, it's very flexible, easy and useful. It seems to have stopped working now:
>"" is None
False
>[] is None
False
>{} is None
False
What's going on?
I'm using Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) [GCC 4.4.5], on Debian/Sid i686 GNU/Linux.
Edit: Awesome tip from Sven Marnach of using bool(""). brb, off to edit some code...
is Noneisn't for testing empty variables, it's for testing precisely if they areNone.