[issue41120] Possible performance improvement for itertools.product example on Python Docs

2020-06-26 Thread Abbas Taher
Abbas Taher added the comment: Good morning Raymond,   Thank you for this quick response. You are absolutely right on all your points if you only consider that the example given in the documentation as purely a suggestion of "equivalent" version to the one implemented in the library. However,

[issue41120] Possible performance improvement for itertools.product example on Python Docs

2020-06-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the suggestion, but the purpose of the rough equivalent example is to give a better idea of what product() does. It is not about performance — that job falls to the actual implementation. Nested generators are an intermediate level Python

[issue41120] Possible performance improvement for itertools.product example on Python Docs

2020-06-25 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41120] Possible performance improvement for itertools.product example on Python Docs

2020-06-25 Thread Abbas Taher
New submission from Abbas Taher : In the documentation the following example is given: def product(*args, repeat=1): # product('ABCD', 'xy') --> Ax Ay Bx By Cx Cy Dx Dy # product(range(2), repeat=3) --> 000 001 010 011 100 101 110 111 pools = [tuple(pool) for pool in args] * repeat