On Sun, Sep 6, 2015 at 8:19 PM, Carl Meyer <[email protected]> wrote:
> In this model, there's a bijection between aware
> datetimes in any two timezones. (This model requires the PEP 495 flag,
> or some equivalent.
>
A nitpick, but since I am also guilty of such loose usage of the term
"bijection", it may be worth a clarification. We often say that there is a
bijection between two sets when in fact there is only a bijection between a
subset of one set an a subset of another. In a particular case of aware
datetimes with tzinfo=UTC and tzinfo=Local, a set U = {u ∈ datetime |
u.tzinfo is UTC, u.fold=0} maps to a subset of L= {t ∈ datetime | u.tzinfo
is Local}. This map creates a bijection between U and its image under the
map, but we are still ignoring the possibility that timezone correction may
take you out of [datetime.min, datetime.max] range. To rigorously
construct a mathematical bijection - you need to account for those edge
effects as well.
_______________________________________________
Datetime-SIG mailing list
[email protected]
https://mail.python.org/mailman/listinfo/datetime-sig
The PSF Code of Conduct applies to this mailing list:
https://www.python.org/psf/codeofconduct/