Re: [Python-3000] PEP3102 Keyword-Only Arguments

2006-08-14 Thread Nick Coghlan
Steven Bethard wrote: > [Steven Bethard] >> It would be really nice in the example above to mark ``self`` in >> ``__call__`` as a positional only argument. > > [Nick Coghlan] >> However, I'm also wondering if we need an actual syntax, or if a simple >> convention would do the trick: start the name

Re: [Python-3000] PEP3102 Keyword-Only Arguments

2006-08-14 Thread Josiah Carlson
Aahz <[EMAIL PROTECTED]> wrote: > > On Mon, Aug 14, 2006, Guido van Rossum wrote: > > On 8/14/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > >> > >> However, I'm also wondering if we need an actual syntax, or if a simple > >> convention would do the trick: start the names of positional-only argume

Re: [Python-3000] PEP3102 Keyword-Only Arguments

2006-08-14 Thread Aahz
On Mon, Aug 14, 2006, Guido van Rossum wrote: > On 8/14/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: >> >> However, I'm also wondering if we need an actual syntax, or if a simple >> convention would do the trick: start the names of positional-only arguments >> with an underscore. > > Hm... and perh

Re: [Python-3000] PEP3102 Keyword-Only Arguments

2006-08-14 Thread Steven Bethard
[Steven Bethard] > It would be really nice in the example above to mark ``self`` in > ``__call__`` as a positional only argument. [Nick Coghlan] > However, I'm also wondering if we need an actual syntax, or if a simple > convention would do the trick: start the names of positional-only arguments >

Re: [Python-3000] PEP3102 Keyword-Only Arguments

2006-08-14 Thread Guido van Rossum
On 8/14/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > However, I'm also wondering if we need an actual syntax, or if a simple > convention would do the trick: start the names of positional-only arguments > with an underscore. Hm... and perhaps we could forbid keyword arguments starting with an und

Re: [Python-3000] PEP3102 Keyword-Only Arguments

2006-08-14 Thread Nick Coghlan
Guido van Rossum wrote: >> It would be really nice in the example above to mark ``self`` in >> ``__call__`` as a positional only argument. > > But this is a rather unusual use case isn't it? It's due to the bound > methods machinery. Do you have other use cases? I would assume that > normally such

Re: [Python-3000] PEP3102 Keyword-Only Arguments; Signature

2006-08-14 Thread Guido van Rossum
On 8/14/06, Jim Jewett <[EMAIL PROTECTED]> wrote: > On 8/14/06, Steven Bethard <[EMAIL PROTECTED]> wrote: > > On 8/14/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > I believe the PEP doesn't address the opposite use case: positional > > > arguments that should *not* be specified as keyword a

Re: [Python-3000] PEP3102 Keyword-Only Arguments

2006-08-14 Thread Steven Bethard
On 8/14/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 8/14/06, Steven Bethard <[EMAIL PROTECTED]> wrote: > > On 8/14/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > I believe the PEP doesn't address the opposite use case: positional > > > arguments that should *not* be specified as key

Re: [Python-3000] PEP3102 Keyword-Only Arguments; Signature

2006-08-14 Thread Jim Jewett
On 8/14/06, Steven Bethard <[EMAIL PROTECTED]> wrote: > On 8/14/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > I believe the PEP doesn't address the opposite use case: positional > > arguments that should *not* be specified as keyword arguments. ... > It would be really nice in the example ab

Re: [Python-3000] PEP3102 Keyword-Only Arguments

2006-08-14 Thread Guido van Rossum
On 8/14/06, Steven Bethard <[EMAIL PROTECTED]> wrote: > On 8/14/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > I believe the PEP doesn't address the opposite use case: positional > > arguments that should *not* be specified as keyword arguments. For > > example, I might want to write > > > >

Re: [Python-3000] PEP3102 Keyword-Only Arguments

2006-08-14 Thread Steven Bethard
On 8/14/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I believe the PEP doesn't address the opposite use case: positional > arguments that should *not* be specified as keyword arguments. For > example, I might want to write > > def foo(a, b): ... > > but I don't want callers to be able to cal

Re: [Python-3000] PEP3102 Keyword-Only Arguments

2006-08-14 Thread Guido van Rossum
Not remembering the PEP in detail, I agree with Jim's resolution of all these. I guess the right rule is that all positional arguments come first (first the regular ones, then * or *args). Then come the keyword arguments, again, first the regular ones (name=value), then **kwds. I believe the PEP

Re: [Python-3000] PEP3102 Keyword-Only Arguments

2006-08-12 Thread Jim Jewett
On 8/11/06, Jiwon Seo <[EMAIL PROTECTED]> wrote: > When we have keyword-only arguments, do we allow 'keyword dictionary' > argument? If that's the case, where would we want to place > keyword-only arguments? > Are we going to allow any of followings? > 1. def foo(a, b, *, key1=None, key2=None, *

[Python-3000] PEP3102 Keyword-Only Arguments

2006-08-11 Thread Jiwon Seo
When we have keyword-only arguments, do we allow 'keyword dictionary' argument? If that's the case, where would we want to place keyword-only arguments? Are we going to allow any of followings? 1. def foo(a, b, *, key1=None, key2=None, **map) 2. def foo(a, b, *, **map, key1=None, key2=None) 3.