On 01/25/2014 04:34 AM, Chris Angelico wrote:
On Sat, Jan 25, 2014 at 3:07 PM, Larry Hastings <la...@hastings.org> wrote:

What should it be?

A) pydoc and help() should not show bound parameters in the signature, like
inspect.signature.

Vote for A. As far as I'm concerned, all these foo are equally
callable and equally take one parameter named a:

[snip]

To strengthen this argument:

--> import inspect
--> from functools import partial
--> def lots_of_args(a, b, c, d=3, e='wow', f=None):
...    print(a, b, c, d, e, f)
...
--> str(inspect.signature(lots_of_args))
"(a, b, c, d=3, e='wow', f=None)"

--> curried = partial(lots_of_args, 9, f='Some')
--> str(inspect.signature(curried))
"(b, c, d=3, e='wow', f='Some')"

While I partially agree with Antoine that the whole self thing is confusing, I think it would be more accurate to only give help (and a signature) on parameters that you can actually change; if you are calling a bound method there is no way to pass in something else in place of self.

So I vote for A.

--
~Ethan~
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to