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 belopolsky
Recipients belopolsky, eric.snow, jackdied, jess.austin, mark.dickinson, ncoghlan, ysj.ray
Date 2013-08-12.22:51:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376347914.41.0.606908135425.issue5516@psf.upfronthosting.co.za>
In-reply-to
Content
Eric,

Could you share details of your use-case?  My experience with subclassing from basic python types including date/time has been mostly negative.  The problem is that when I subclass, I want to inherit the rich set of operations such as +, -, *, etc., and add a few methods of my own.  After that, I want to always use instances of my subclass instead of the stdlib one.  This does not work because adding instances of my subclass returns an instance of the superclass unless I override __add__ explicitly. (See   #2267.)  This kills all benefits of subclassing as compared to containment.

These days I try to stay away from subclassing date/time, int/float, or anything like that and thus have little incentive to resolve this issue.  And it does not look like we have a workable solution.
History
Date User Action Args
2013-08-12 22:51:54belopolskysetrecipients: + belopolsky, mark.dickinson, ncoghlan, jackdied, jess.austin, ysj.ray, eric.snow
2013-08-12 22:51:54belopolskysetmessageid: <1376347914.41.0.606908135425.issue5516@psf.upfronthosting.co.za>
2013-08-12 22:51:54belopolskylinkissue5516 messages
2013-08-12 22:51:54belopolskycreate