Tim Chase wrote:
> As an aside, as of the last time I read the PEP[1] on this, I
> believe it exhausts (or attempts to exhaust) any iterator. IMHO,
> I think this exhausting is a bad idea because it prevents things like
>
>def numbers(start=0):
> i = start
> while True:
>yi
Chris Rebert wrote:
On Wed, Feb 25, 2009 at 1:16 AM, Helmut Jarausch
wrote:
Sorry if this is too simple but I couldn't find.
I vaguely remember there is a means to assign a variable length tuple
and catch the 'rest' like
S="a,b,c,d"
(A,B,) = S.split(',')
In Python 3.0 (IIRC):
A, B, *rest
On Wed, Feb 25, 2009 at 1:16 AM, Helmut Jarausch
wrote:
> Sorry if this is too simple but I couldn't find.
>
> I vaguely remember there is a means to assign a variable length tuple
> and catch the 'rest' like
>
> S="a,b,c,d"
>
> (A,B,) = S.split(',')
In Python 3.0 (IIRC):
A, B, *rest = S.split(
Sorry if this is too simple but I couldn't find.
I vaguely remember there is a means to assign a variable length tuple
and catch the 'rest' like
S="a,b,c,d"
(A,B,) = S.split(',')
I know I could do
SL= split(',')
(A,B)=SL[:2]
Rest= SL[2:]
but is there some shorthand for this?
Many thanks for