summaryrefslogtreecommitdiff
path: root/six.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2013-03-11 19:06:10 -0500
committerBenjamin Peterson <benjamin@python.org>2013-03-11 19:06:10 -0500
commit4597d988dd21252fc709b594efae7d32ea8316bd (patch)
tree1422725c2d509ca2110c12ee2b78428039123789 /six.py
parent201e8e5619c8e755936de98adea4a0ea6e8d6776 (diff)
downloadsix-4597d988dd21252fc709b594efae7d32ea8316bd.tar.gz
add six.iterlists
Diffstat (limited to 'six.py')
-rw-r--r--six.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/six.py b/six.py
index ab45e38..d389ffe 100644
--- a/six.py
+++ b/six.py
@@ -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):