Re: Rats! vararg assignments don't work

2007-07-12 Thread samwyse
On May 30, 7:29 am, Sion Arrowsmith <[EMAIL PROTECTED]> wrote: > samwyse <[EMAIL PROTECTED]> wrote: > >>samwysewrote: > >>>I thought that I'd try this: > >>> first, *rest = arglist > >>>Needless to say, it didn't work. > > [ ... ] > >My use-case is (roughtly) this: > > first, *rest = f.read

Re: Rats! vararg assignments don't work

2007-05-30 Thread Alex Martelli
samwyse <[EMAIL PROTECTED]> wrote: ... > Actually, I'm surprised that the PEP does as much as it does. If tuples > are implemented as S-expressions, then something like this: Tuples are implemented as compact arrays of pointer-to-PyObject (so are lists, BTW). So, for example, a 10-items tuple

Re: Rats! vararg assignments don't work

2007-05-30 Thread Sion Arrowsmith
samwyse <[EMAIL PROTECTED]> wrote: >> samwyse wrote: >>>I thought that I'd try this: >>> first, *rest = arglist >>>Needless to say, it didn't work. > [ ... ] >My use-case is (roughtly) this: > first, *rest = f.readline().split() > return dispatch_table{first}(*rest) first, rest = f.re

Re: Rats! vararg assignments don't work

2007-05-30 Thread Maric Michaud
samwyse a écrit : > George Sakkis wrote: >> On May 29, 11:33 pm, Matimus <[EMAIL PROTECTED]> wrote: >> >> >>> Your attemtp: >>> >>> [code] >>> first, rest = arglist[0], arglist[1:] >>> [/code] >>> >>> Is the most obvious and probably the most accepted way to do what you >>> are looking for. As for

Re: Rats! vararg assignments don't work

2007-05-30 Thread Bruno Desthuilliers
Matimus a écrit : (snip) > Remember, in Python "there is only one way to do it". Actually, it's : "There should be one-- and preferably only one --obvious way to do it.". ... Which is quite different. Please notice the "should", "preferably" and "obvious". -- http://mail.python.org/mailman/lis

Re: Rats! vararg assignments don't work

2007-05-30 Thread Wildemar Wildenburger
George Sakkis wrote: > The time machine did it again: http://www.python.org/dev/peps/pep-3132/. > > Uhm, John Swartzwelder, right? :D /W -- http://mail.python.org/mailman/listinfo/python-list

Re: Rats! vararg assignments don't work

2007-05-30 Thread samwyse
George Sakkis wrote: > On May 29, 11:33 pm, Matimus <[EMAIL PROTECTED]> wrote: > > >>Your attemtp: >> >>[code] >>first, rest = arglist[0], arglist[1:] >>[/code] >> >>Is the most obvious and probably the most accepted way to do what you >>are looking for. As for adding the fucntionality you first

Re: Rats! vararg assignments don't work

2007-05-30 Thread samwyse
Gary Herron wrote: > samwyse wrote: > >>I'm a relative newbie to Python, so please bear with me. After seeing >>how varargs work in parameter lists, like this: >> def func(x, *arglist): >>and this: >> x = func(1, *moreargs) >>I thought that I'd try this: >> first, *rest = arglist >>N

Re: Rats! vararg assignments don't work

2007-05-29 Thread Gary Herron
samwyse wrote: > I'm a relative newbie to Python, so please bear with me. After seeing > how varargs work in parameter lists, like this: > def func(x, *arglist): > and this: > x = func(1, *moreargs) > I thought that I'd try this: > first, *rest = arglist > Needless to say, it didn'

Re: Rats! vararg assignments don't work

2007-05-29 Thread George Sakkis
On May 29, 11:33 pm, Matimus <[EMAIL PROTECTED]> wrote: > Your attemtp: > > [code] > first, rest = arglist[0], arglist[1:] > [/code] > > Is the most obvious and probably the most accepted way to do what you > are looking for. As for adding the fucntionality you first suggested, > it isn't likely t

Re: Rats! vararg assignments don't work

2007-05-29 Thread Matimus
Your attemtp: [code] first, rest = arglist[0], arglist[1:] [/code] Is the most obvious and probably the most accepted way to do what you are looking for. As for adding the fucntionality you first suggested, it isn't likely to be implemented. The first step would be to write a PEP though. Remember