New submission from Paul Ganssle <p.gans...@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 <rep...@bugs.python.org> <https://bugs.python.org/issue36004> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com