Message372706
This code behaves differently when PYTHONASYNCIODEBUG=1
import asyncio
import inspect
@asyncio.coroutine
def foo():
yield from asyncio.sleep(0)
print("isgeneratorfunction:", inspect.isgeneratorfunction(foo))
PYTHONASYNCIODEBUG:
isgeneratorfunction: False
non-debug mode:
isgeneratorfunction: True
When in debug mode, the `asyncio.coroutine` decorator returns a function that is not a generator function (https://github.com/python/cpython/blob/bd4a3f21454a6012f4353e2255837561fc9f0e6a/Lib/asyncio/coroutines.py#L144)
The result is that introspection of functions is changed when PYTHONASYNCIODEBUG is enabled. |
|
Date |
User |
Action |
Args |
2020-06-30 17:14:21 | a-feld | set | recipients:
+ a-feld, asvetlov, yselivanov |
2020-06-30 17:14:21 | a-feld | set | messageid: <1593537261.43.0.523552907091.issue41174@roundup.psfhosted.org> |
2020-06-30 17:14:21 | a-feld | link | issue41174 messages |
2020-06-30 17:14:21 | a-feld | create | |
|