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 amaury.forgeotdarc
Recipients Arfrever, amaury.forgeotdarc, chris.jerdonek, r.david.murray
Date 2012-07-02.12:33:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1341232413.9.0.680141220561.issue15223@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-07-02 12:33:34amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, Arfrever, r.david.murray, chris.jerdonek
2012-07-02 12:33:33amaury.forgeotdarcsetmessageid: <1341232413.9.0.680141220561.issue15223@psf.upfronthosting.co.za>
2012-07-02 12:33:33amaury.forgeotdarclinkissue15223 messages
2012-07-02 12:33:32amaury.forgeotdarccreate