On Sun, Apr 19, 2020 at 3:39 AM Paul Ganssle <[email protected]> wrote:
>
> A few weeks ago, I submitted PEP 615 to the steering council for a decision.
> There's been a decent amount of discussion there with some very good
> questions. I think they are mostly resolved (though I'm happy to have other
> people look over the logic of some of my responses there), but Victor brought
> up the question of the equality and hash behavior of ZoneInfo, and while I'm
> leaning one way, I could easily be convinced - particularly if people have
> real use cases that they are planning to implement that would be affected by
> this.
>
> I've summed up the options on the discourse thread, and would appreciate if
> anyone is able to give some feedback.
>
> Thanks!
In every use-case that I've ever had, and every one that I can
imagine, I've not cared about the difference between "US/Eastern" and
"America/New_York". In fact, if ZoneInfo("US/Eastern") returned
something that had a name of "America/New_York", I would be fine with
that. Similarly, Australia/Melbourne and Australia/Sydney are, to my
knowledge, equivalent. (If I'm wrong on my own country's history of
timezones, then I apologize and withdraw the example, but I'm talking
about cases where you absolutely cannot tell the difference based on
the displayed time.) Having those compare equal would be convenient.
I don't think it's a problem to have equivalent objects unable to
coexist in a set. That's just the way sets work - len({5, 5.0}) is 1,
not 2.
Since options 3 and 4 are the most expensive, I'm fine with the idea
of a future method that would test for equivalence, rather than having
them actually compare equal; but I'd also be fine with having
ZoneInfo("US/Eastern") actually return the same object that
ZoneInfo("America/New_York") returns. For the equality comparison, I
would be happy with proposal 2.
ChrisA
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/JPUGSSXX2MWF3ABH3QNHXSMNVDWMRVJS/
Code of Conduct: http://python.org/psf/codeofconduct/