[Python-Dev] Quick poll: should help() show bound arguments?

Larry Hastings larry at hastings.org
Sat Jan 25 14:29:05 CET 2014


On 01/25/2014 03:34 AM, Anders J. Munch wrote:
> Larry Hastings wrote:
>>
>> inspect.signature gets this right:
>>
>>     >>> import inspect
>>     >>> str(inspect.signature(c.foo))
>>     '(a)'
>>
>
> Not always.
>
> : Python 3.4.0b2+ (default:32f9e0ae23f7, Jan 18 2014, 13:56:31)
> : [GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
> : Type "help", "copyright", "credits" or "license" for more information.
> : >>> import inspect
> : >>> class C1:
> : ...     def f(*args, **kwargs): pass
> : ...
> : >>> c = C1()
> : >>> c.f()
> : >>> str(inspect.signature(c.f))
> : '(**kwargs)'

File a bug, if there hasn't already been one filed.


//arry/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140125/d263dffe/attachment.html>


More information about the Python-Dev mailing list