[issue20223] inspect.signature does not support new functools.partialmethod

Yury Selivanov report at bugs.python.org
Sat Jan 11 22:22:59 CET 2014


New submission from Yury Selivanov:

new and handy functools.partialmethod doesn't fully support inspect.signature.

For instance, for the following code:

    class Spam:
        def say(self, a, b=1):
            print(a)
        hello = functools.partialmethod(say, 'hello')

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)'.

----------
components: Library (Lib)
files: signature_partialmeth_01.patch
keywords: patch
messages: 207915
nosy: brett.cannon, larry, ncoghlan, yselivanov
priority: normal
severity: normal
status: open
title: inspect.signature does not support new functools.partialmethod
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file33418/signature_partialmeth_01.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20223>
_______________________________________


More information about the Python-bugs-list mailing list