How to create a tuple quickly with list comprehension?
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Wed Jun 13 06:37:02 EDT 2007
More information about the Python-list mailing list
Wed Jun 13 06:37:02 EDT 2007
- Previous message (by thread): How to create a tuple quickly with list comprehension?
- Next message (by thread): How to create a tuple quickly with list comprehension?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In <5d9ngkF32j8imU1 at mid.uni-berlin.de>, Diez B. Roggisch wrote: > No need to create the intermediate list, a generator expression works just > fine: > > a = tuple(i for i in range(10)) But `range()` creates the intermediate list anyway. ;-) a = tuple(xrange(10)) Ciao, Marc 'BlackJack' Rintsch
- Previous message (by thread): How to create a tuple quickly with list comprehension?
- Next message (by thread): How to create a tuple quickly with list comprehension?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list