You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
inspect.signature does not support new functools.partialmethod #64422
Note: 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:
assignee=Noneclosed_at=<Date2014-01-27.22:29:56.377>created_at=<Date2014-01-11.21:22:59.504>labels= ['type-bug', 'library']
title='inspect.signature does not support new functools.partialmethod'updated_at=<Date2014-01-27.22:29:56.376>user='https://github.com/1st1'
This strikes me as a bug introduced with the new 3.4 feature and thus a Type: behavior issue eligible for 3.4. inspect.signature should work correctly with any python-coded callable and not return a wrong answer. (And we are trying to get inspect to work with C-coded callables also in 3.4.)
Aye, I agree with Terry that this is a behavioural bug introduced with the new partialmethod feature - we missed adding a new test case to check that inspect.signature handled it properly.
Yury, I believe the review comments from Rietveld go to the address you have registered as primary in the tracker, so that's currently your address with the ".ml" suffix rather than your main one.
My only suggestion was to use ._partialmethod for the attribute name, rather than __partialmethod__, since this feels a bit more like an ordinary private attribute, rather than a new protocol. Lots of introspection tools deliberately *display* dunder names, and that doesn't really feel appropriate here.
As far as pushing goes, I'd wait until Larry lands bpo-20189 - I suspect there's a risk of conflict between these patches in the inspect module, and that one is key to getting builtin signatures supported properly :)
Activity
1st1 commentedon Jan 11, 2014
new and handy functools.partialmethod doesn't fully support inspect.signature.
For instance, for the following code:
the 'signature(Spam.hello)' will always return '(*args, **keywords)'
I'm attaching a patch that fixes that, so the signature for the above example will be '(self, b=1)'.
terryjreedy commentedon Jan 17, 2014
This strikes me as a bug introduced with the new 3.4 feature and thus a Type: behavior issue eligible for 3.4. inspect.signature should work correctly with any python-coded callable and not return a wrong answer. (And we are trying to get inspect to work with C-coded callables also in 3.4.)
ncoghlan commentedon Jan 19, 2014
Aye, I agree with Terry that this is a behavioural bug introduced with the new partialmethod feature - we missed adding a new test case to check that inspect.signature handled it properly.
Reviewing the patch now.
1st1 commentedon Jan 23, 2014
Nick, can I push this?
larryhastings commentedon Jan 23, 2014
I'm not sure why you're asking Nick. Is he the release manager for 3.4?
1st1 commentedon Jan 23, 2014
I'm asking him because he wrote "Reviewing the patch now.", and I thought that he might have actually seen the patch already.
I'm more than fine if anyone else reviews the patch, really.
ncoghlan commentedon Jan 24, 2014
Yury, I believe the review comments from Rietveld go to the address you have registered as primary in the tracker, so that's currently your address with the ".ml" suffix rather than your main one.
My only suggestion was to use ._partialmethod for the attribute name, rather than __partialmethod__, since this feels a bit more like an ordinary private attribute, rather than a new protocol. Lots of introspection tools deliberately *display* dunder names, and that doesn't really feel appropriate here.
ncoghlan commentedon Jan 24, 2014
As far as pushing goes, I'd wait until Larry lands bpo-20189 - I suspect there's a risk of conflict between these patches in the inspect module, and that one is key to getting builtin signatures supported properly :)
larryhastings commentedon Jan 24, 2014
The patch from bpo-20189 has landed.
python-dev commentedon Jan 27, 2014
New changeset baedc256999a by Yury Selivanov in branch 'default':
inspect.signature: Add support for 'functools.partialmethod' bpo-20223
http://hg.python.org/cpython/rev/baedc256999a
1st1 commentedon Jan 27, 2014
Thanks for the review, Nick.
Closing the issue now.