Skip to content

Instantly share code, notes, and snippets.

@kunigami

kunigami/callable.py

Last active Dec 26, 2019
Embed
What would you like to do?
def typed_map(xs: List[int], f: Callable[[int], int]) -> List[int]:
return [f(x) for x in xs]
print(typed_map([1, 2, 3], lambda x: x*2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.