Paul Ganssle <p.gans...@gmail.com> added the comment:

This is the expected behavior of `.fromisoformat()`. A similar issue is 
https://bugs.python.org/issue35829, which asks for the "Z" suffix to be 
supported.

There is a note about this in the documentation: 
https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat

"Caution This does not support parsing arbitrary ISO 8601 strings - it is only 
intended as the inverse operation of datetime.isoformat(). A more full-featured 
ISO 8601 parser, dateutil.parser.isoparse is available in the third-party 
package dateutil."

At some point we will work out the kinks in offering as full an ISO 8601 
datetime parser as possible, but the ISO 8601 datetime spec is very complicated 
and includes many optional features. We deliberately chose to keep the scope of 
`.fromisoformat()` minimal at first, whereas `dateutil.parser.isoparse` 
attempts to be a full-featured ISO8601 parser.

Changing the version affected to 3.10, since this is a feature request.

----------
type: behavior -> enhancement
versions: +Python 3.10 -Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42371>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to