Re:Recharging the Python standard library
by d23 on Friday October 11, 2013 @04:20PM
(#6535722)
My only gripe with datetime and time are the organization of it. I can never remember whether it's datetime.datetime.now or datetime.now or time.timedelta or datetime.timedelta, and so on.
[ Parent
| on HN ]
Re:Recharging the Python standard library
by falcolas on Friday October 11, 2013 @05:21PM
(#6535997)
Yeah, typing datetime.datetime for everything gets pretty old.
I just remember that datetime is the package, datetime.datetime is the class, and datetime.datetime.now() is a @classmethod that returns instances of that class. I do kinda wish it was datetime.now() for the constructor instead.