[Python-Dev] Curious datetime method

Anders Sandvig anders.sandvig at gmail.com
Wed Jul 21 13:03:20 CEST 2010


On Tue, Jul 20, 2010 at 5:56 PM, Alexander Belopolsky
<alexander.belopolsky at gmail.com> wrote:
> In the real world where we have to take backward compatibility into
> account, I would like to make today() and now() to be the same: both
> taking optional tz argument, both available as either date or datetime
> methods and both covariant.  the justification for having two methods
> doing exactly the same will be just readability: date.today() and
> datetime.now() are more readable than date.now() and datetime.today().

I agree. Unless, of course, someone has a good explanation/reason for
why today() and now() are implemented differently (i.e. a use case
where the difference is significant).


Anders


More information about the Python-Dev mailing list