Message188870
Since range objects have a known length, that example is not enough to show 'any iterable'. However, generators do not even have a __length_hint__ and they work too.
a = [1,2,3]
a[0:1] = (i for i in range(4))
print(a)
>>>
[0, 1, 2, 3, 2, 3] |
|
Date |
User |
Action |
Args |
2013-05-10 19:45:39 | terry.reedy | set | recipients:
+ terry.reedy, ezio.melotti, docs@python, stefanchrobot |
2013-05-10 19:45:39 | terry.reedy | set | messageid: <1368215139.65.0.111265653015.issue17939@psf.upfronthosting.co.za> |
2013-05-10 19:45:39 | terry.reedy | link | issue17939 messages |
2013-05-10 19:45:39 | terry.reedy | create | |
|