{{ message }}
Conversation
6 tasks
jklymak
commented
Sep 27, 2019
Member
Author
There was a problem hiding this comment.
Note that in the old code dstart=vmin-(vmax-vmin) for some reason, and dstop = vmax + (vmax - vmin). Expanding the range by a factor of three doesn't make much sense to me. The test that changed (test_DateFormatter), in my opinion, changed for the better. So this is a mildly breaking change, but it gives far more consistent results.
| MO, TU, WE, TH, FR, SA, SU) | ||
| WEEKDAYS = (MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY) | ||
|
|
||
| class _datetimey(datetime.datetime): |
Member
Author
There was a problem hiding this comment.
my guess is that this whole class should go in its own file...
6 tasks
Member
|
Is this still relevant, now that we can set the epoch? |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PR Summary
This is a WIP, but for discussion as to whether this is worth the extra code.
It is easy to make negative datetime64 objects, or large datetime64 objects that are greater than 10000 years, whereas right now we restrict to between year 1 and 9999 because we use
datetime.datetime.The obvious solution is to use
datetime64, but that falls down because a) we want to be able to deal with timezones, anddatetime64doesn't by default. b) we want to usedateutil.rrulefor things like "put a tick every other Wednesday".So, the solution proposed here is to derive a subclass of
datetimethat keeps track of more years than 1-9999 (I'm not actually clear whydatetimerestricts to these values in the first place). I've attempted (probably poorly) to make the subclass as minimal as possible, and to call the super as often as possible.Before
This PR:
PR Checklist