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

Alexander Belopolsky alexander.belopolsky at gmail.com
Sat Sep 12 03:39:20 CEST 2015


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

> That's what the politicians gave us. These are datetime objects, not
> mathematical numbers.


That's an argument for not defining mathematical operations like <, > or -
on them, but you cannot deny the convenience of having those.  Besides,
datetime objects are mathematical numbers as long as you only deal with one
timezone or restrict yourself to naive instances.  The problem with
interzone subtraction, for example, is that we start with nice (not so
little) integers and define an operation that is effectively op(x, y) =
f(x) - g(y) where f and g are arbitrary functions under the control of
the politicians.
It is convenient to equate op with subtraction and if f and g are simple
shifts, it is a subtraction, but in general it is not.  This is the root of
the problem, but datetime objects are still as close to mathematical
numbers as Python ints.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150911/cbe9765a/attachment.html>


More information about the Python-Dev mailing list