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.
> B) pydoc and help() should show bound parameters in the signature, like
> inspect.getfullargspec.

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

def foo1(a): pass

class C:
    def foo(self, a): pass
foo2=C().foo

class C:
    def __call__(self, a): pass
foo3=C()

def two_arg(b, a): pass
foo4=lambda a: two_arg(0, a)

If I call them as fooN(), fooN(1), and fooN(1,2), the middle one works
and the other two throw exceptions, ergo they are one-argument
functions. The fact that two of them happen to be bound methods is an
implementation detail; it's just a form of currying, which foo4
happens also to be (in that C.foo takes two args, C().foo takes one).

ChrisA
_______________________________________________
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