mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Backported from the trunk, on Raymond's request:
SF bug #849662. Dramatically, improve comparison speed for "if shl == None".
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user