Message107520
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.) |
|
Date |
User |
Action |
Args |
2010-06-11 02:37:56 | r.david.murray | set | recipients:
+ r.david.murray, belopolsky, techtonik |
2010-06-11 02:37:56 | r.david.murray | set | messageid: <1276223876.5.0.119131670429.issue8903@psf.upfronthosting.co.za> |
2010-06-11 02:37:53 | r.david.murray | link | issue8903 messages |
2010-06-11 02:37:50 | r.david.murray | create | |
|