[New-bugs-announce] [issue36004] Add datetime.fromisocalendar
Paul Ganssle
report at bugs.python.org
Fri Feb 15 09:28:36 EST 2019
New submission from Paul Ganssle <p.ganssle at gmail.com>:
Datetime has many methods that "serializes" an instance to some other format - toordinal, timestamp, isoformat, etc. Most methods that "serialize" a datetime have a corresponding method that "deserializes" that method, or another way to reverse the operation:
- strftime / strptime
- timestamp / fromtimestamp
- isoformat / fromisoformat
- toordinal / fromordinal
- timetuple / datetime(*thetuple[0:6])
However, as I found out when implementing `dateutil.parser.isoparse`, there is no simple way to invert `isocalendar()`.
I have an implementation as part of dateutil.parser.isoparse:
https://github.com/dateutil/dateutil/blob/master/dateutil/parser/isoparser.py#L297
If there are no objections, I'd like to add an implementation in CPython itself. Thinking the name should be `fromisocalendar`.
----------
components: Library (Lib)
messages: 335616
nosy: belopolsky, lemburg, p-ganssle
priority: low
severity: normal
status: open
title: Add datetime.fromisocalendar
type: enhancement
versions: Python 3.8
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36004>
_______________________________________
More information about the New-bugs-announce
mailing list