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`. |