[issue46614] Add option to output UTC datetimes as "Z" in `.isoformat()`

2022-04-03 Thread Matt Wozniski
Matt Wozniski added the comment: > My main hesitation with this name is that I suspect users may think that > `use_utc_designator` means that they *unconditionally* want to use `Z` — > without reading the documentation (which we can assume 99% of users won't do) I was thinking along similar

[issue46614] Add option to output UTC datetimes as "Z" in `.isoformat()`

2022-04-03 Thread Éric Araujo
Éric Araujo added the comment: Bad idea: pass `zulu=True` It is short, memorable if you know about it, otherwise obscure enough to push people to read the docs and be clear about what it does. Also strange and far from obvious, so a bad idea. Unless… ? --

[issue46614] Add option to output UTC datetimes as "Z" in `.isoformat()`

2022-04-03 Thread Paul Ganssle
Paul Ganssle added the comment: I think this approach is probably the best we can do, but I could also imagine that users might find it to be confusing behavior. I wonder if there's any informal user testing we can do? I guess the ISO 8601 spec does call "Z" the "UTC designator", so

[issue46614] Add option to output UTC datetimes as "Z" in `.isoformat()`

2022-03-21 Thread Matt Wozniski
Change by Matt Wozniski : -- keywords: +patch pull_requests: +30131 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32041 ___ Python tracker

[issue46614] Add option to output UTC datetimes as "Z" in `.isoformat()`

2022-02-11 Thread Matt Wozniski
Matt Wozniski added the comment: > I feel like "If the offset is 00:00, use Z" is the wrong rule to use > conceptually This is a really good point that I hadn't considered: `+00:00` and `Z` are semantically different, and just because a datetime has a UTC offset of 0 doesn't mean it should

[issue46614] Add option to output UTC datetimes as "Z" in `.isoformat()`

2022-02-08 Thread Éric Araujo
Éric Araujo added the comment: Would it be horrible to have the timezone instance control this? -- nosy: +eric.araujo ___ Python tracker ___

[issue46614] Add option to output UTC datetimes as "Z" in `.isoformat()`

2022-02-02 Thread Paul Ganssle
New submission from Paul Ganssle : As part of bpo-35829, it was suggested that we add the ability to output the "Z" suffix in `isoformat()`, so that `fromisoformat()` can both be the exact functional inverse of `isoformat()` and parse datetimes with "Z" outputs. I think that that's not a