[Python-ideas] Set starting point for itertools.product()

Ronie Martinez ronmarti18 at gmail.com
Wed Oct 24 23:47:18 EDT 2018


Hi,

My idea is to set the starting point for itertools.product()
<https://docs.python.org/3.6/library/itertools.html#itertools.product>
since it becomes very slow if the point of interest is in the middle. For
example when working with datetime tuples with seconds resolution (worst
case, milli/microseconds), you need to skip a lot of items.

There are several methods I have tried as an alternative but
itertools.product() is the fastest:
- datetime and timedelta
- naive looping

This is where I applied it but the issue at seconds resolution is still a
bottleneck:
https://github.com/Code-ReaQtor/DocCron/blob/1.0.0/doccron/job.py#L171

Setting the starting point might come in handy if we want to skip several
data.
What do you think?

Best Regards,
Ronie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20181025/5772046d/attachment.html>


More information about the Python-ideas mailing list