Implement PEP 495
See original GitHub issueIssue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
PEP 495 – Local Time Disambiguation
Return a datetime.time object with the specified hour, minute, second, microsecond and fold. Affected Behaviors. What time is it?
Read more >Deprecation notice regarding PEP 495 in APScheduler
I am having difficulty using APScheduler in Python 3.73. Running any script that uses this library seems to give me the following warning:...
Read more >PEP 495 and the hardest problem in computer science
This particular PEP will be implemented in Python 3.6 and concerns adding a new attribute called fold to the datetime.time and datetime.time ...
Read more >Re: [Python-Dev] PEP 495 implementation - The Mail Archive
This time I am adding python-dev to BCC in hopes to reach a larger audience. With the date of the first beta (2016-09-07)...
Read more >What's New In Python 3.6
PEP 495 – Local Time Disambiguation: PEP written by Alexander Belopolsky and Tim Peters, implementation by Alexander Belopolsky.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@systemcatch Why is
dateutil
pinned at all in this library? I don’t think that’s a good idea at all.Anyway, I don’t really have time for this, so someone else will have to take it up.
I will take a crack at this a bit later. I think it’s not terribly difficult, but from an implementation perspective, the one major question about a backport is whether you want the compatibility code at runtime (makes the code itself cleaner) or at import time (code may run faster).
So, for example, say I implement a
fold
property inarrow
:Alternatively, it can be done this way:
The third, and I think best option would be to use
dateutil.tz.enfold
, which already backports almost all the functionality of PEP 495 (with the exception of dateutil/dateutil#344, which is hard for dateutil to fix but easy for arrow). The only problem with this approach is thattz.enfold
was introduced indateutil
version 2.6.0, meaning you’d need to pin to >=2.6.0. If that’s a problem, it might be best to backport theenfold
function into arrow.