Skip to content

kitsuyui/dict_zip

Repository files navigation

dict_zip

zip and zip_longest for dict.

Python PyPI version codecov License dict-zip

Installation

$ pip install dict-zip

Usage

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

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)}

Type hints

dict_zip supports for type hints.

screen-shot-of-type-hints

LICENSE

The 3-Clause BSD License. See also LICENSE file.