Commit a3522a8a authored by Stefan Behnel's avatar Stefan Behnel

extend test

parent cead8846
...@@ -527,3 +527,31 @@ def iteritems_of_expression(*args, **kwargs): ...@@ -527,3 +527,31 @@ def iteritems_of_expression(*args, **kwargs):
[('a', 3), ('b', 4)] [('a', 3), ('b', 4)]
""" """
return [item for item in dict(*args, **kwargs).iteritems()] return [item for item in dict(*args, **kwargs).iteritems()]
def for_in_items_of_expression(*args, **kwargs):
"""
>>> sorted(for_in_items_of_expression(a=3, b=4))
[('a', 3), ('b', 4)]
>>> sorted(for_in_items_of_expression([('a', 3)], b=4))
[('a', 3), ('b', 4)]
"""
result = []
for k, v in dict(*args, **kwargs).items():
result.append((k, v))
return result
def for_in_iteritems_of_expression(*args, **kwargs):
"""
>>> sorted(for_in_iteritems_of_expression(a=3, b=4))
[('a', 3), ('b', 4)]
>>> sorted(for_in_iteritems_of_expression([('a', 3)], b=4))
[('a', 3), ('b', 4)]
"""
result = []
for k, v in dict(*args, **kwargs).iteritems():
result.append((k, v))
return result
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment