Alexander Belopolsky added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5516>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to