Steven Howe a écrit : (snip) > I've read and found that 'None' comparisons is not always a good idea. > Better to: > from types import NoneType > > x = None > if type( x ) == NoneType: > # true > < code > > else: > # false; do something else. > < more code >
Actually, None is garanteed to be a singleton, so the idiomatic way is to use an identity test: if x is None: # code here But this doesn't answer the OP... HTH -- http://mail.python.org/mailman/listinfo/python-list