>>> a = OrderedSet([1,2,3]) if some_condition else None
>>> print a
None # a.k.a. a is 'None' in this case
...
>>> # later on...
>>> if a == None:
... # do something
throws the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/me/.virtualenvs/virtualblah/bin/../lib/python2.7/_abcoll.py", line 186, in __ne__
return not (self == other)
File "_orderedset.pyx", line 445, in orderedset._orderedset.OrderedSet.__eq__ (lib/orderedset/_orderedset.c:7554)
TypeError: 'NoneType' object is not iterable
Same if you do a != None but of course the exception is thrown in __ne__ in that case
throws the following error:
Same if you do
a != None
but of course the exception is thrown in__ne__
in that case