Anand wrote:
>>>Wouldn't it be nice to say
>>>id, *tokens = line.split(',')
>>
>>
>>id, tokens_str = line.split(',', 1)
> 
> 
> But then you have to split tokens_str again.
> 
> id, tokens_str = line.split(',', 1)
> tokens = tokens_str.split(',')
> 
> this is too verbose.
> 

head_tail = lambda seq: seq[0], seq[1:]

...
id, tokens = head_tail(line.split(','))


but I do like the syntax you're proposing !-)

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to