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

2014-01-24 Thread Larry Hastings
(Quick, because apparently nobody reads the long ones!) In Python 3.3: >>> class C: ...def foo(self, a): pass ... >>> c = C() >>> help(c.foo) shows you the signature "foo(self, a)". As in, it claims it accepts two parameters. The function actually only accepts one par

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

2014-01-24 Thread Zachary Ware
On Fri, Jan 24, 2014 at 10:07 PM, Larry Hastings wrote: > > (Quick, because apparently nobody reads the long ones!) > > In Python 3.3: > class C: > ...def foo(self, a): pass > ... c = C() help(c.foo) > > shows you the signature "foo(self, a)". As in, it claims it accepts two >

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

2014-01-24 Thread Steven D'Aprano
On Fri, Jan 24, 2014 at 08:07:43PM -0800, Larry Hastings wrote: > > (Quick, because apparently nobody reads the long ones!) > > In Python 3.3: > > >>> class C: >...def foo(self, a): pass >... > >>> c = C() > >>> help(c.foo) > > shows you the signature "foo(self, a)". T

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

2014-01-24 Thread Nick Coghlan
On 25 January 2014 14:36, Steven D'Aprano wrote: > On Fri, Jan 24, 2014 at 08:07:43PM -0800, Larry Hastings wrote: >> 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 >> ins

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

2014-01-24 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/24/2014 11:07 PM, Larry Hastings wrote: > 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. +1 for

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

2014-01-25 Thread Anders J. Munch
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", "copy

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

2014-01-25 Thread Chris Angelico
On Sat, Jan 25, 2014 at 3:07 PM, Larry Hastings 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 a

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

2014-01-25 Thread Larry Hastings
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

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

2014-01-25 Thread Antoine Pitrou
On Fri, 24 Jan 2014 20:07:43 -0800 Larry Hastings wrote: > > A) pydoc and help() should not show bound parameters in the signature, > like inspect.signature. -1 from me. The problem is this will make help(c.foo) inconsistent with help(c) and help(C), and is bound to confuse newcomers. Speaking

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

2014-01-25 Thread Larry Hastings
On 01/25/2014 05:37 AM, Antoine Pitrou wrote: Speaking of which, I think asking for votes before all arguments have been made is counter-productive. Sorry, I didn't realize there was an established protocol for this. //arry/ ___ Python-Dev mailing l

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

2014-01-25 Thread Antoine Pitrou
On Sat, 25 Jan 2014 05:42:58 -0800 Larry Hastings wrote: > On 01/25/2014 05:37 AM, Antoine Pitrou wrote: > > Speaking of which, I think asking for votes before all arguments have > > been made is counter-productive. > > Sorry, I didn't realize there was an established protocol for this. No, the

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

2014-01-25 Thread Ethan Furman
On 01/25/2014 04:34 AM, Chris Angelico wrote: On Sat, Jan 25, 2014 at 3:07 PM, Larry Hastings 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