diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-15 05:19:02 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-15 05:19:02 +0000 |
commit | ab10f0843be45529925a226dc54a9fd0a30ad159 (patch) | |
tree | 78a01816c55f81e557d0416b2b1e4b4c95df31c8 /ipalib/plugable.py | |
parent | a24f2121d553644513dc90d423b9ac968de34bc2 (diff) | |
download | freeipa-ab10f0843be45529925a226dc54a9fd0a30ad159.tar.gz freeipa-ab10f0843be45529925a226dc54a9fd0a30ad159.tar.xz freeipa-ab10f0843be45529925a226dc54a9fd0a30ad159.zip |
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__()
Diffstat (limited to 'ipalib/plugable.py')
-rw-r--r-- | ipalib/plugable.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 57ab8bc74..811a5527f 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -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 |