This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author p-ganssle
Recipients belopolsky, hongweipeng, jwilk, mehaase, p-ganssle, rdb
Date 2019-08-27.19:23:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1566933811.34.0.76775617565.issue35829@roundup.psfhosted.org>
In-reply-to
Content
> Defining isoformat() and fromisoformat() as functional inverses is misguided. Indeed, it's not even true:

`isoformat()` is not the inverse of `fromisoformat()`, that doesn't work because there are multiple strings that isoformat() can create from any given datetime. There is, however, only one datetime that is represented by any given datetime (assuming you consider truncation to create a new datetime), so it is fine for fromisoformat() to be the inverse of isoformat().

I have explained the reason that was chosen for the contract in several places (including in this thread), so I won't bother to repeat it. I think from a practical point of view we should eventually grow more generalized ISO 8601 parsing functionality, and the main question is what the API will look like. In dateutil.parser.isoparse, I still haven't figured out a good way to do feature flags.

> I'd be willing to work on a PR, but a change of this size probably needs to through python-ideas first?

I don't think it *needs* to go to python-ideas, though it's probably a good idea to try and work out the optimal API in a post on the discourse ( discuss.python.org ), and the "ideas" category seems like the right one there. Please CC me (pganssle) if you propose modifications to the fromisoformat API on the discourse.
History
Date User Action Args
2019-08-27 19:23:31p-gansslesetrecipients: + p-ganssle, belopolsky, jwilk, rdb, mehaase, hongweipeng
2019-08-27 19:23:31p-gansslesetmessageid: <1566933811.34.0.76775617565.issue35829@roundup.psfhosted.org>
2019-08-27 19:23:31p-gansslelinkissue35829 messages
2019-08-27 19:23:31p-gansslecreate