◐ Shell
clean mode source ↗

Message 125979 - Python tracker

Note that before r82065, python prototype, now available as Lib/datetime.py had binary operations implemented to return subclass instances.  Here is annotated pre-r82065 code:


 39876 gvanrossum     def __add__(self, other):
 39876 gvanrossum         if isinstance(other, timedelta):
 39928 gvanrossum             return self.__class__(self.__days + other.__days,
 39876 gvanrossum                                   self.__seconds + other.__seconds,
 39876 gvanrossum                                   self.__microseconds + other.__microseconds)
 40207    tim_one         return NotImplemented
 39876 gvanrossum