comparison mercurial/namespaces.py @ 32550:b98199a5c3e1

cleanup: rename all iteritems methods to items and add iteritems alias Due to a quirk of our module importer setup on Python 3, all calls and definitions of methods named iteritems() get rewritten at import time. Unfortunately, this means there's not a good portable way to access these methods from non-module-loader'ed code like our unit tests. This change fixes that, which also unblocks test-manifest.py from passing under Python 3. We don't presently define any itervalues methods, or we'd need to give those similar treatment.
author Augie Fackler <raf@durin42.com>
date Mon, 29 May 2017 00:00:02 -0400
parents bd872f64a8ba
children 46fa46608ca5
comparison
equal deleted inserted replaced
32549:633c635a790a 32550:b98199a5c3e1
64 return self._names[namespace] 64 return self._names[namespace]
65 65
66 def __iter__(self): 66 def __iter__(self):
67 return self._names.__iter__() 67 return self._names.__iter__()
68 68
69 def iteritems(self): 69 def items(self):
70 return self._names.iteritems() 70 return self._names.iteritems()
71
72 iteritems = items
71 73
72 def addnamespace(self, namespace, order=None): 74 def addnamespace(self, namespace, order=None):
73 """register a namespace 75 """register a namespace
74 76
75 namespace: the name to be registered (in plural form) 77 namespace: the name to be registered (in plural form)