isoparser strictness clarification and relaxation #622
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My goal for the isoparser in the future is to allow more customization of the parse to allow the user to be more or less strict than the ISO 8601 standard, but I think it's time to get the 2.7.0 release out the door, so I've tweaked the documentation to indicate that the strictness of the default
isoparseis not something to rely on (until the strictness can be specified).Additionally, in a nod to pragmatism (since a huge number of people use ISO 8601 with a space separator rather than a
Tseparator), I've relaxed the strictness of the parser to accept any single ASCII character by default, rather than justT. This brings the behavior more in line with the forthcomingdatetime.fromisoformatalternate constructor - though there are thingsfromisoformataccepts that this function won't, and things this function accepts thatfromisoformatwon't, for the majority of peopledateutil.parser.isoparsewill work perfectly well as a substitute fordatetime.fromisoformat.