Issue 26654: asyncio is not inspecting keyword arguments of functools.partial (original) (raw)

Issue26654

Created on 2016-03-28 09:57 by iceboy, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 552 closed dstufft,2017-03-31 16:36
Messages (6)
msg262566 - (view) Author: iceboy (iceboy) * Date: 2016-03-28 09:57
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: Exception in callback foo()() at ...:4 Expected error message: Exception in callback foo(x=1)() at ...:4
msg262588 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2016-03-29 01:35
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
msg262608 - (view) Author: iceboy (iceboy) * Date: 2016-03-29 12:40
Created a PR https://github.com/python/asyncio/pull/328. Please review. Thanks.
msg262631 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-03-29 21:54
> Oh, wow. I didn't even know we special-case partial() there. I wrote the code doing that. I did it to get more readable and shorter logs since asyncio produces a lot of logs. Example: Exception in callback print("Hello", "World!")() at ...:4 without special case: Exception in functools.partial(, 'Hello', 'World!') at ...:4
msg276610 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-15 20:02
New changeset 4ab64ea31d75 by Yury Selivanov in branch '3.5': Issue #26654: Inspect functools.partial in asyncio.Handle.__repr__. https://hg.python.org/cpython/rev/4ab64ea31d75 New changeset 03257f04ee9f by Yury Selivanov in branch '3.6': Merge 3.5 (issue #26654) https://hg.python.org/cpython/rev/03257f04ee9f New changeset 1dbe3addba28 by Yury Selivanov in branch 'default': Merge 3.6 (issue #26654) https://hg.python.org/cpython/rev/1dbe3addba28
msg276611 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2016-09-15 20:02
Merged! Thank you!
History
Date User Action Args
2022-04-11 14:58:29 admin set github: 70841
2017-03-31 16:36:35 dstufft set pull_requests: + <pull%5Frequest1083>
2016-09-15 20:02:53 yselivanov set status: open -> closedresolution: fixedmessages: + stage: resolved
2016-09-15 20:02:23 python-dev set nosy: + python-devmessages: +
2016-03-29 21:54:39 vstinner set messages: +
2016-03-29 12:40:15 iceboy set messages: +
2016-03-29 01:35:39 gvanrossum set messages: +
2016-03-28 09:57:30 iceboy create