Timeline for Multiple iterators in a single for statement
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 27, 2017 at 20:41 | comment | added | cs95 | @Błotosmętek And so it does. Thanks yo. | |
Jun 27, 2017 at 20:32 | comment | added | Błotosmętek |
And anyway, even in Python 2.x it is better to use itertools.chain , as it avoids creating temporary lists, which might be a memory hog for large ranges.
|
|
Jun 27, 2017 at 20:29 | comment | added | Błotosmętek |
@Coldspeed dir(range(1)) confirms your suspicion.
|
|
Jun 27, 2017 at 19:59 | comment | added | cs95 |
"possibly because range is generated on the fly" actually, I don't think range has a __add__ method implemented, that's why. Can someone confirm?
|
|
Jun 27, 2017 at 19:55 | history | edited | physicist | CC BY-SA 3.0 |
added 111 characters in body
|
Jun 27, 2017 at 19:55 | comment | added | jonrsharpe | Not in Python 3.x, it won't. | |
Jun 27, 2017 at 19:49 | history | answered | physicist | CC BY-SA 3.0 |