Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Invoking a subclass's constructor is only an issue when subclass adds data members. In this case, arithmetic methods need to be overridden. Note that my patch does not make __add__ and friends invoke subclass' constructor, only subclass' tp_alloc.
Existing code already does this in some cases. For example, >>> class d(datetime): pass ... >>> d.strptime('20080310', '%Y%m%d') d(2008, 3, 10, 0, 0) >>> d.now() d(2008, 3, 10, 20, 27, 6, 303147) I think date/datetime present a particularly compelling case for departing from the general rule. These classes are minimal by design and need to be extended in many applications. __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2267> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com