Terry J. Reedy added the comment:

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]

----------
nosy: +terry.reedy

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17939>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to