Commit f477c884 authored by Raymond Hettinger's avatar Raymond Hettinger

SF bug #849662. Dramatically, improve comparison speed for "if shl == None".

parent edfb3025
......@@ -155,6 +155,8 @@ class DictMixin:
def __repr__(self):
return repr(dict(self.iteritems()))
def __cmp__(self, other):
if other is None:
return 1
if isinstance(other, DictMixin):
other = dict(other.iteritems())
return cmp(dict(self.iteritems()), other)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment