Closed defterade closed 5 years ago
Category:
Can be done in a single line.
Current code:
def map_values(obj, fn): ret = {} for key in obj.keys(): ret[key] = fn(obj[key]) return ret
Suggested replacement:
def map_values(obj, fn): return {key: fn(obj[key]) for key in obj}
Resolved in #102
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for any follow-up tasks.
Category:
Description
Can be done in a single line.
Current Snippet Behavior
Current code:
Possible Solution
Suggested replacement: