|
|
|
|
|
by yde_java
340 days ago
|
|
I use the Python package 'sorcery' [0] in all my production services. It gives dict unpacking but also a shorthand dict creation like this: from sorcery import dict_of, unpack_keys
a, b = unpack_keys({'a': 1, 'b': 42})
assert a == 1
assert b == 42
assert dict_of(a, b) == {'a': 1, 'b': 42}
[0] https://github.com/alexmojaki/sorcery |
|