3 ms·
Exactly. The working code in Python, as a function, would be: def extract(mapping, *args, **kwargs): for a in args: yield mapping[a]
by BiteCode_dev 4y ago
Exactly.
The working code in Python, as a function, would be:
def extract(mapping, *args, **kwargs):
for a in args:
yield mapping[a]
for key, default in kwargs.items():
yield mapping.get(key, default)