[Python-ideas] Re: Datetime operation in itertools count

2022-02-10 Thread Stephen J. Turnbull
Christopher Barker writes: > agreed. But we seem to be getting a mixed message here: > > 1) it's too coplex with too many variable that have to be thought through s/too//g please. I haven't seen any explicit -1s yet, just "I'm not gonna do it myself for sure". @Aman Paul's discussion

[Python-ideas] Re: Datetime operation in itertools count

2022-02-10 Thread Christopher Barker
On Thu, Feb 10, 2022 at 9:25 AM Paul Moore wrote: > Maybe. It still needs someone to get down to details and propose > something specific. And I'll still be between -0.5 and -1 on it, but > you don't need to convince me personally, you just need some level of > support from *some* of the core

[Python-ideas] Re: Datetime operation in itertools count

2022-02-10 Thread Paul Moore
On Thu, 10 Feb 2022 at 17:11, Christopher Barker wrote: > agreed. But we seem to be getting a mixed message here: > > 1) it's too coplex with too many variable that have to be thought through and > won't satisfy everyone anyway. > > and > > 2) It's just a simple one-liner > > Those are kind of

[Python-ideas] Re: Datetime operation in itertools count

2022-02-10 Thread Christopher Barker
On Thu, Feb 10, 2022 at 9:02 AM Paul Moore wrote: > > [*] now that I think about it, I would probably only do this without DST > — including DST would require a DST database, which the stdlib doesn’t > include. > > https://docs.python.org/3/library/zoneinfo.html My Bad -- I forgot about that

[Python-ideas] Re: Datetime operation in itertools count

2022-02-10 Thread Christopher Barker
On Thu, Feb 10, 2022 at 8:57 AM David Mertz, Ph.D. wrote: > Don't forget leap seconds! :-) > TAI only :-) -CHB On Thu, Feb 10, 2022, 11:45 AM Christopher Barker > wrote: > >> Since a started this:-) >> >> 1) the complexities are exactly why this *might* be a candidate for the >> stdlib.

[Python-ideas] Re: Datetime operation in itertools count

2022-02-10 Thread Paul Moore
On Thu, 10 Feb 2022 at 16:44, Christopher Barker wrote: > > Since a started this:-) > > 1) the complexities are exactly why this *might* be a candidate for the > stdlib. Those are the things that someone is likely to get wrong, or not > think of, when they write something quick themselves, and

[Python-ideas] Re: Datetime operation in itertools count

2022-02-10 Thread David Mertz, Ph.D.
Don't forget leap seconds! :-) On Thu, Feb 10, 2022, 11:45 AM Christopher Barker wrote: > Since a started this:-) > > 1) the complexities are exactly why this *might* be a candidate for the > stdlib. Those are the things that someone is likely to get wrong, or not > think of, when they write

[Python-ideas] Re: Datetime operation in itertools count

2022-02-10 Thread Christopher Barker
Since a started this:-) 1) the complexities are exactly why this *might* be a candidate for the stdlib. Those are the things that someone is likely to get wrong, or not think of, when they write something quick themselves, and only lightly test. 2) it doesn’t have to be everything for everyone-

[Python-ideas] Re: Datetime operation in itertools count

2022-02-10 Thread Paul Moore
On Thu, 10 Feb 2022 at 15:21, Aman Pandey wrote: > > Hello Stephen, I think you misunderstood it. we are not talking about > modifying the existing built-in function range rather adding a new function > in datetime module that will generate the date and time between two periods. > if we add a

[Python-ideas] Re: Datetime operation in itertools count

2022-02-10 Thread Aman Pandey
Hello Stephen, I think you misunderstood it. we are not talking about modifying the existing built-in function range rather adding a new function in datetime module that will generate the date and time between two periods. if we add a function like that in the datetime module the code will be

[Python-ideas] Re: Datetime operation in itertools count

2022-02-10 Thread Stephen J. Turnbull
Christopher Barker writes: > There have been a couple recipes on this thread for an iterator, but I > envision something like the range() object — it’s a lazy Sequence, not just > an iterator. I would be strongly against an extension to range() itself (I think that was the original proposal),

[Python-ideas] Re: Datetime operation in itertools count

2022-02-09 Thread Christopher Barker
As I said, it’s an interesting exercise in any case. I have no idea if the core devs would be interested in adding it. There have been a couple recipes on this thread for an iterator, but I envision something like the range() object — it’s a lazy Sequence, not just an iterator. I think that

[Python-ideas] Re: Datetime operation in itertools count

2022-02-09 Thread Aman Pandey
I can give it a try, but I have never done it before and anything which I should be knowing beforehand because it will be my first time. I would like to listen from other fellow developers what they think about this? On Wed, Feb 9, 2022 at 1:09 PM Christopher Barker wrote: > I think a

[Python-ideas] Re: Datetime operation in itertools count

2022-02-08 Thread Christopher Barker
I think a datetime.range object could be useful. Perhaps someone can write one and then see if the core devs would accept it in the stdlib. It would be na interesting exercise in any case :-) -CHB On Tue, Feb 8, 2022 at 10:38 PM Aman Pandey wrote: > I get your point. I checked the code which

[Python-ideas] Re: Datetime operation in itertools count

2022-02-08 Thread Aman Pandey
I get your point. I checked the code which is in C and implement the solution which was something similar to yours. Should we have some function like that in the datetime module that can generate date, and time as well between two ranges? This looks like a feature to me that can be helpful.

[Python-ideas] Re: Datetime operation in itertools count

2022-02-08 Thread Chris Angelico
On Wed, 9 Feb 2022 at 01:00, Aman Pandey wrote: > > I wanted to generate all the dates between two date ranges for which I was > using count function in the itertools and to my surprise count function > doesn't support datetime operation. > > For example > >import datetime > >from itertools

[Python-ideas] Re: Datetime operation in itertools count

2022-02-08 Thread Paul Moore
On Tue, 8 Feb 2022 at 14:00, Aman Pandey wrote: > > I wanted to generate all the dates between two date ranges for which I was > using count function in the itertools and to my surprise count function > doesn't support datetime operation. > > For example > >import datetime > >from itertools