]> granicus.if.org Git - python/commit
bpo-34890: Make iscoroutinefunction, isgeneratorfunction and isasyncgenfunction work...
authorPablo Galindo <Pablogsal@gmail.com>
Fri, 26 Oct 2018 11:19:14 +0000 (12:19 +0100)
committerGitHub <noreply@github.com>
Fri, 26 Oct 2018 11:19:14 +0000 (12:19 +0100)
commit7cd25434164882c2093ea41ccfc7b95a05cd5cbd
tree76c33543b495e78b0e520dd4914da68dcf616dae
parente483f02423917dc4dfd25f46e5b9e6fce304777d
bpo-34890: Make iscoroutinefunction, isgeneratorfunction and isasyncgenfunction work with functools.partial (GH-9903)

inspect.isfunction() processes both inspect.isfunction(func) and
inspect.isfunction(partial(func, arg)) correctly but some other functions in the
inspect module (iscoroutinefunction, isgeneratorfunction and isasyncgenfunction)
lack this functionality. This commits adds a new check in the mentioned functions
in the inspect module so they can work correctly with arbitrarily nested partial
functions.
Doc/library/inspect.rst
Lib/functools.py
Lib/inspect.py
Lib/test/test_asyncio/test_tasks.py
Lib/test/test_inspect.py
Misc/NEWS.d/next/Library/2018-10-15-23-10-41.bpo-34890.77E770.rst [new file with mode: 0644]