BUG: Use six viewkeys.

This commit is contained in:
Scott Sanderson
2016-03-28 09:24:56 -04:00
parent 9e0ad5de15
commit a932628627
+4 -3
View File
@@ -1,7 +1,8 @@
from operator import methodcaller
from six.moves import map
from pprint import pformat
from six import viewkeys
from six.moves import map
def mapall(funcs, seq):
"""
@@ -76,7 +77,7 @@ def dzip_exact(*dicts):
>>> dzip_exact({'a': 1, 'b': 2}, {'a': 3, 'b': 4})
{'a': (1, 3), 'b': (2, 4)}
"""
if not same(*map(methodcaller('viewkeys'), dicts)):
if not same(*map(viewkeys, dicts)):
raise ValueError(
"dict keys not all equal:\n\n%s" % _format_unequal_keys(dicts)
)