[issue7989] Add pure Python implementation of datetime module to CPython
Marc-Andre Lemburg
report at bugs.python.org
Sat Jul 3 00:52:33 CEST 2010
Marc-Andre Lemburg <mal at egenix.com> added the comment:
Alexander Belopolsky wrote:
>
> Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:
>
> On Fri, Jul 2, 2010 at 6:00 PM, Tim Peters <report at bugs.python.org> wrote:
>>
>> Tim Peters <tim.peters at gmail.com> added the comment:
>>
>>> Do you remember why it was a good idea to
>>> derive datetime from date?
>>
>> Why not? A datetime is a date, but with additional behavior. Makes inheritance conceptually natural.
>
> It is also time with additional behavior. In the face of ambiguity ...
>
> Why not? See issue #5516. Most of datetime comparison code is
> devoted to fighting inheritance from date. There is hardly any
> non-trivial method that benefits from this inheritance.
>
> To me, conceptually, datetime is a container of date, time and
> optionally time zone, it is not a date.
Just an aside:
Conceptually, you don't need date and time, only an object to
reference a point in time and another one to describe the
difference between two points in time. In mxDateTime I
called them DateTime and DateTimeDelta.
What we commonly refer to as date is really the combination of
a DateTime value pointing to the start of the day together with
a DateTimeDelta value representing one full turn of the Earth.
That said, I don't think redesigning the datetime module is part
of this ticket, just adding a second implementation of what we
already have in CPython :-)
----------
title: Add pure Python implementation of datetime module to CPython -> Add pure Python implementation of datetime module to CPython
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7989>
_______________________________________
More information about the Python-bugs-list
mailing list