Unpacking a single tuple _or_ a pair
Oleg Broytmann
phd at phd.russ.ru
Mon Mar 13 10:26:37 EST 2000
More information about the Python-list mailing list
Mon Mar 13 10:26:37 EST 2000
- Previous message (by thread): Unpacking a single tuple _or_ a pair
- Next message (by thread): Unpacking a single tuple _or_ a pair
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, 13 Mar 2000, Peter Bittner wrote:
> for i in range(len(datalist)):
> try:
> value, text = datalist[i] # separate pair's values
> except:
> text, = datalist[i] # assume single value on fail
> value = ''
Just check len(datalist[i])...
Oleg.
----
Oleg Broytmann Foundation for Effective Policies phd at phd.russ.ru
Programmers don't die, they just GOSUB without RETURN.
- Previous message (by thread): Unpacking a single tuple _or_ a pair
- Next message (by thread): Unpacking a single tuple _or_ a pair
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list