We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
assignee = None
closed_at = <Date 2018-10-26.11:23:04.921>
created_at = <Date 2018-10-04.07:29:56.296>
labels = ['3.8', 'library']
title = 'Support functools.partial in inspect.is*function() checks'
updated_at = <Date 2022-02-13.06:36:40.836>
user = 'https://github.com/asvetlov'
activity = <Date 2022-02-13.06:36:40.836>
actor = 'Dennis Sweeney'
assignee = 'none'
closed = True
closed_date = <Date 2018-10-26.11:23:04.921>
closer = 'pablogsal'
components = ['Library (Lib)']
creation = <Date 2018-10-04.07:29:56.296>
creator = 'asvetlov'
dependencies = 
files = 
hgrepos = 
issue_num = 34890
keywords = ['patch']
message_count = 5.0
messages = ['327039', '327056', '327057', '328538', '413171']
nosy_count = 4.0
nosy_names = ['asvetlov', 'yselivanov', 'pablogsal', 'Dennis Sweeney']
pr_nums = ['9903']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue34890'
versions = ['Python 3.8']
The text was updated successfully, but these errors were encountered:
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?
Sorry, something went wrong.
I think the fact that inspect.isfunction recognizes partials is a very strong argument to enable inspect.iscoroutinefunction to do so as well.
This is a backwards incompatible change though, strictly speaking.
Feel free to work on the PR. If we want to push this to 3.8 we should do that now and have enough time for it to be tested.
New changeset 7cd2543 by Pablo Galindo in branch 'master':
bpo-34890: Make iscoroutinefunction, isgeneratorfunction and isasyncgenfunction work with functools.partial (GH-9903)
See https://bugs.python.org/issue46722 for a concern about this change.
No branches or pull requests