-
Daniele Nicolodi authored
Using functools.total_ordering does not work when inheriting from datetime.timedelta because the class appears to already implement all the comparison methods. Avoid massive code duplication with clever(?) dynamic function generation. The same technique could be used to generate methods implementing binary functions. Also add a __neg__() implementation.
Daniele Nicolodi authoredUsing functools.total_ordering does not work when inheriting from datetime.timedelta because the class appears to already implement all the comparison methods. Avoid massive code duplication with clever(?) dynamic function generation. The same technique could be used to generate methods implementing binary functions. Also add a __neg__() implementation.