diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-03-11 19:06:10 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-03-11 19:06:10 -0500 |
commit | 4597d988dd21252fc709b594efae7d32ea8316bd (patch) | |
tree | 1422725c2d509ca2110c12ee2b78428039123789 /six.py | |
parent | 201e8e5619c8e755936de98adea4a0ea6e8d6776 (diff) | |
download | six-4597d988dd21252fc709b594efae7d32ea8316bd.tar.gz |
add six.iterlists
Diffstat (limited to 'six.py')
-rw-r--r-- | six.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -215,6 +215,7 @@ if PY3: _iterkeys = "keys" _itervalues = "values" _iteritems = "items" + _iterlists = "lists" else: _meth_func = "im_func" _meth_self = "im_self" @@ -225,6 +226,7 @@ else: _iterkeys = "iterkeys" _itervalues = "itervalues" _iteritems = "iteritems" + _iterlists = "iterlists" try: @@ -279,6 +281,10 @@ def iteritems(d): """Return an iterator over the (key, value) pairs of a dictionary.""" return iter(getattr(d, _iteritems)()) +def iterlists(d): + """Return an iterator over the (key, [values]) pairs of a dictionary.""" + return iter(getattr(d, _iterlists)()) + if PY3: def b(s): |