Commits

Thomas Heller committed a096d7b

Backported from the trunk, on Raymond's request:

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

  • Participants
  • Parent commits 915aa0e
  • Branches 2.3

Comments (0)

Files changed (1)

File Lib/UserDict.py

     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)