Message83040
Maybe premature optimization but maybe it would make sense to implement
__eq__ like this:
def __eq__(self, other):
if isinstance(other, OrderedDict):
if not dict.__eq__(self, other):
return False
return all(p == q for p, q in _zip_longest(self.items(),
other.items()))
return dict.__eq__(self, other)
For the most likely case (that dicts are different) this should give a
speedup. |
|
Date |
User |
Action |
Args |
2009-03-02 21:41:12 | aronacher | set | recipients:
+ aronacher, georg.brandl, rhettinger, jimjjewett, pitrou |
2009-03-02 21:41:12 | aronacher | set | messageid: <1236030072.15.0.247790959202.issue5397@psf.upfronthosting.co.za> |
2009-03-02 21:41:10 | aronacher | link | issue5397 messages |
2009-03-02 21:41:10 | aronacher | create | |
|