summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-11-17 17:57:34 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-11-17 17:57:34 +0100
commitadd08632b8a66c7ba5de7ab44d8a10ec9462692e (patch)
tree0365f91dfffed677d1e298989875eb5e7134e47b /apt
parentf2cd844828de310dc510505612395ef60ded8731 (diff)
downloadpython-apt-add08632b8a66c7ba5de7ab44d8a10ec9462692e.tar.gz
allow Dependency object to be iteratable, this allows to write
code like: for or_dep_group in pkg.candidate.dependencies: for dep in or_dep_group: do_something()
Diffstat (limited to 'apt')
-rw-r--r--apt/package.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/apt/package.py b/apt/package.py
index e09acca4..ab692788 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -107,6 +107,9 @@ class Dependency(object):
def __repr__(self):
return repr(self.or_dependencies)
+ def __iter__(self):
+ return self.or_dependencies.__iter__()
+
class DeprecatedProperty(property):
"""A property which gives DeprecationWarning on access.