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
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
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
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
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
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
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
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
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'
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
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
11 matches
Mail list logo