Created
February 22, 2019 16:04
-
-
Save BurhanH/0c90d63cd32466556d5e81c869d6a389 to your computer and use it in GitHub Desktop.
How to use a lambda expression as an asynchronous function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
f = asyncio.coroutine(lambda x: x**2) | |
asyncio.get_event_loop().run_until_complete(f(12)) | |
# 144 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment