Message164513
In PyPy, datetime.py is a pure Python module (similar to the one in 3.x, but without the _datetime acceleration module). So comparison with CPython is not relevant here.
In CPython, __module__ is not an attribute of the type, but a property: it is defined in the 'type' object. The situation is similar to the following script (2.x syntax); the "foo" attribute can be found on the class, but not on instances of the class.
class Type(type):
foo = 42
class Datetime:
__metaclass__ = Type
print Datetime.foo
print Datetime().foo
This is a good thing sometimes: for example 'str' has a __dict__ (containing methods) but strings don't have a __dict__ -- storage is optimized and only has an array of chars. In this case you wouldn't want the class __dict__ be returned instead. |
|
Date |
User |
Action |
Args |
2012-07-02 12:33:34 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, Arfrever, r.david.murray, chris.jerdonek |
2012-07-02 12:33:33 | amaury.forgeotdarc | set | messageid: <1341232413.9.0.680141220561.issue15223@psf.upfronthosting.co.za> |
2012-07-02 12:33:33 | amaury.forgeotdarc | link | issue15223 messages |
2012-07-02 12:33:32 | amaury.forgeotdarc | create | |
|