Last active
December 11, 2016 07:16
-
-
Save malinoff/148507bf51ff8b9a0a947c178aa0ac3a to your computer and use it in GitHub Desktop.
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 | |
from _pytest.compat import is_generator | |
async def foo(): | |
await foo() | |
async def bar(): | |
pass | |
print(is_generator(foo)) | |
from _pytest._code import getrawcode | |
print(is_generator(foo)) | |
print(is_generator(bar)) | |
@asyncio.coroutine | |
def baz(): | |
yield from bar() | |
def zap(): | |
yield | |
print(is_generator(baz)) | |
print(is_generator(zap)) |
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
$ python example.com | |
False | |
32 | |
0 | |
32 | |
32 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment