Re: [Python-3000] PEP 3102 comments

2006-05-25 Thread Baptiste Carvello
> > Here's a related but more complicated wish: define a function in such > > a way that certain parameters *must* be passed as keywords, *without* > > using *args or **kwds. This may require a new syntactic crutch. > > While a number of people have submitted possible use cases for this > feat

Re: [Python-3000] Immutable lists

2006-05-25 Thread Nick Coghlan
Greg Ewing wrote: > Nick Coghlan wrote: > >> This is exactly what I was trying to get at when I suggested using >> "tuple[T]" as the notation for an arbitrary length tuple with elements >> of type T > > If tuple[T] is an arbitrary-length tuple, then how > do you spell a 1-tuple with element typ

Re: [Python-3000] What makes infix operators special? (was Re: Type parameterization

2006-05-25 Thread Nick Coghlan
Greg Ewing wrote: > Nick Coghlan wrote: > >> Using '@' would now be fairly counterintuitive, given that symbol's >> association with decorators. > > It would be very disappointing if @ were now considered > too "polluted" by association with decorators to be used > for anything else, since it wo

Re: [Python-3000] PEP 3102 comments

2006-05-25 Thread Nick Coghlan
Greg Ewing wrote: > tomer filiba wrote: >> talin asked for comments, so >> >> def f(a, b, *, c, d) >> >> seems wrong to me. '*' can't be a token on its own, at least >> that's the way i see it. opeators shouldn't stand for themselves. > > But * is not an operator here. It's just a token > with a s

Re: [Python-3000] Immutable lists

2006-05-25 Thread Guido van Rossum
On 5/25/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Yes - I'm saying tuple[T1, T2] should describe an arbitrary length tuple whose > elements are 2-tuples, *instead* of being equivalent to (T1, T2). > > Since we have 2 notations (a tuple of type descriptions, and a subscript > operation on the tu

Re: [Python-3000] PEP 3102 comments

2006-05-25 Thread Guido van Rossum
On 5/25/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > def f(a, b, *(pos1, pos2), c, d): > # Exactly 2 extra positional arguments required -1. This is (nearly?) just an obscure way to say "def f(a, b, pos1, pos2)". Suggestion to everyone: please stop proposing alternatives. Let's instead wor

Re: [Python-3000] PEP 3102 comments

2006-05-25 Thread Phillip J. Eby
At 11:42 AM 5/25/2006 +0200, Baptiste Carvello <[EMAIL PROTECTED]> wrote: >maybe those use cases can work without syntactic sugar. With only part 1, you >can already add a manual check if you need: > > >>> def myfunction(a1, a2, *forbidden, kw1, kw2): >...assert forbidden is (), "myfunction()

Re: [Python-3000] PEP 3102 comments

2006-05-25 Thread Greg Ewing
Nick Coghlan wrote: > def f(a, b, *(pos1, pos2), c, d): > # Exactly 2 extra positional arguments required Then someone is going to want def f(a, b, *(pos1, pos2, *args), c, d): # 2 or more positional-only arguments required -- Greg ___

Re: [Python-3000] Immutable lists

2006-05-25 Thread Greg Ewing
> On 5/25/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > >>Yes - I'm saying tuple[T1, T2] should describe an arbitrary length tuple whose >>elements are 2-tuples, *instead* of being equivalent to (T1, T2). Ah, I see. Yes, that would work, although it would make tuple somewhat special in that some