zip and zip_longest for dict.
$ pip install dict-zip
dict_zip
is zip
for dict.
>>> from dict_zip import dict_zip
>>> dict_zip({'a': 1, 'b': 2}, {'a': 3, 'b': 4})
{'a': (1, 3), 'b': (2, 4)}
dict_zip_longest
is zip_longest
for dict.
It fills with fillvalue (default: None
) when argument dict doesn't have match key.
>>> from dict_zip import dict_zip_longest
>>> dict_zip_longest({'a': 1, 'b': 2, 'c': 4}, {'a': 3, 'b': 4})
{'a': (1, 3), 'b': (2, 4), 'c': (4, None)}
dict_zip supports for type hints.
The 3-Clause BSD License. See also LICENSE file.