mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
179: DictProxy now has __call__() method that iterates through the values; removed __call__() method from NameSpace as it subclasses from DictProxys; DictProxy unit tests now test __call__()
This commit is contained in:
@@ -192,6 +192,14 @@ class DictProxy(SetProxy):
|
||||
"""
|
||||
return self.__d[key]
|
||||
|
||||
def __call__(self):
|
||||
"""
|
||||
Iterates (in ascending order by key) through the values in this
|
||||
container.
|
||||
"""
|
||||
for key in self:
|
||||
yield self.__d[key]
|
||||
|
||||
|
||||
class MagicDict(DictProxy):
|
||||
"""
|
||||
@@ -530,14 +538,6 @@ class NameSpace(DictProxy):
|
||||
setattr(self, name, member)
|
||||
yield (name, member)
|
||||
|
||||
def __call__(self):
|
||||
"""
|
||||
Iterates (in ascending order by name) through the members in this
|
||||
NameSpace.
|
||||
"""
|
||||
for key in self:
|
||||
yield self[key]
|
||||
|
||||
def __repr__(self):
|
||||
"""
|
||||
Returns pseudo-valid Python expression that could be used to construct
|
||||
|
||||
Reference in New Issue
Block a user