[Python-Dev] PEP 495 Was: PEP 498: Literal String Interpolation is ready for pronouncement

Alexander Belopolsky alexander.belopolsky at gmail.com
Sat Sep 12 04:34:59 CEST 2015


On Fri, Sep 11, 2015 at 9:51 PM, Glenn Linderman <v+python at g.nevcal.com>
wrote:

> It wasn't intended to argue for not defining the operations, just intended
> to justify that it is partial ordering...


It is not even that.  Note that even partial ordering still requires
transitivity of <=, but we don't have that in datetime:

>>> from datetime import *
>>> from datetimetester import Eastern
>>> UTC = timezone.utc
>>> a = datetime(2002, 4, 7, 1, 40, tzinfo=Eastern)
>>> b = datetime(2002, 4, 7, 2, tzinfo=Eastern)
>>> c = datetime(2002, 4, 7, 6, 20, tzinfo=UTC)
>>> a <= b <= c
True
>>> a <= c
False

The above session is run in the currently released python.  The Eastern
timezone implementation is imported from the CPython test suit.

The fact that transitivity of <= is already broken gives me little comfort
because pretty much everything involving "problem times" is currently
broken and users expect that.  PEP 495, however, is expected to fix the
issues with the problem times and not just replace one broken behavior with
another.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150911/1947d64b/attachment.html>


More information about the Python-Dev mailing list