-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
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? Sign in to your account
asyncio is not inspecting keyword arguments of functools.partial #70841
Comments
import asyncio
import functools
def foo(x): raise Exception()
loop = asyncio.get_event_loop()
loop.call_soon(functools.partial(foo, x=1))
loop.run_forever() Current error message: Expected error message: |
Oh, wow. I didn't even know we special-case partial() there. In general we tend to focus more on positional arguments (since asyncio intentionally doesn't take keyword args for callbacks) but I see no reason why we couldn't add this here. Maybe you're interested in writing a patch yourself? You could do it as a PR for the "upstream" git repo https://github.com/python/asyncio |
Created a PR python/asyncio#328. Please review. Thanks. |
I wrote the code doing that. I did it to get more readable and shorter logs since asyncio produces a lot of logs. Example:
without special case:
|
New changeset 4ab64ea31d75 by Yury Selivanov in branch '3.5': New changeset 03257f04ee9f by Yury Selivanov in branch '3.6': New changeset 1dbe3addba28 by Yury Selivanov in branch 'default': |
Merged! Thank you! |
Misc/NEWS
so that it is managed by towncrier #552Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: