Terry J. Reedy <[email protected]> added the comment:
Timings depend on multiple factors, including implementation (cpython versus pypy versus cython, etc) and complexity of the keep/discard decision. I said in the proposed text that a listcomp may be faster. I think that sufficient; anyone who cares can test their specific case. I like the simple ad easy 'slice replacement = iterator' form because it illustrates to me that we have done something right with Python's design. ---------- _______________________________________ 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
