This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients belopolsky, r.david.murray, techtonik
Date 2010-06-11.02:37:50
SpamBayes Score 9.403422e-05
Marked as misclassified No
Message-id <1276223876.5.0.119131670429.issue8903@psf.upfronthosting.co.za>
In-reply-to
Content
I actually agree with Anatoly here.  I find it much more intuitive to do

  import datetime

   timestamp = datetime.now()

than to do 

   timestamp = datetime.datetime.now()

I always have to remember that 'now' is a class method, often after getting a "datetime module has no attribute 'now'" message.  In most standard library modules a function like that would be, well, a function.  I can't imagine code where I'd find it more convenient to get 'now' from the class, and if I saw code like

    timestamp = othertimestamp.now()

I'd run screaming.

Personally I think the class methods would be better off deprecated in favor of module level functions.

However, all that said, the datetime API is what it is, and I'm not sure it is worth going through a deprecation cycle for this.  (Though othertimestamp.now() really does give me the heebie jeebies.)
History
Date User Action Args
2010-06-11 02:37:56r.david.murraysetrecipients: + r.david.murray, belopolsky, techtonik
2010-06-11 02:37:56r.david.murraysetmessageid: <1276223876.5.0.119131670429.issue8903@psf.upfronthosting.co.za>
2010-06-11 02:37:53r.david.murraylinkissue8903 messages
2010-06-11 02:37:50r.david.murraycreate