Your MyDate
sub-class doesn't override the subtraction function __sub__()
, so inherits the function from the base class, which returns an instance of the base class.
A workaround for what? What are you trying to achieve by sub-classing datetime
?