[New-bugs-announce] [issue34890] Support functools.partial in inspect.is*function() checks

Andrew Svetlov report at bugs.python.org
Thu Oct 4 03:29:56 EDT 2018


New submission from Andrew Svetlov <andrew.svetlov at gmail.com>:

isfunction() processes both `isfunction(func)` and `isfunction(partial(func, arg))` correctly.

But `iscoroutinefunction()` misses this functionality.

We can implement it easy by adding a check for `isinstance(func, partial)` and applying a coroutine check for `func.func`.

Also, we can do the same for `isgeneratorfunction()` and `isasyncgenfunction()`.

The patch looks easy and straightforward.

Yuri, what do you think about?

----------
components: Library (Lib)
messages: 327039
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Support functools.partial in inspect.is*function() checks
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34890>
_______________________________________


More information about the New-bugs-announce mailing list