Raymond Hettinger <[email protected]> added the comment:
Sorry for the wording of the last message. Go ahead with whatever you would
like do :-)
Was only trying to point-out that the generator semantics don't interact nicely
with slice assignments:
$ python3.9 -m timeit -s 'a=list(range(1000))' 'b=a[:]' 'b[:]=(x for x in
a)'
5000 loops, best of 5: 46.6 usec per loop
$ python3.9 -m timeit -s 'a=list(range(1000))' 'b=a[:]' 'b[:]=[x for x in
a]'
10000 loops, best of 5: 26.3 usec per loop
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue41774>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com