-
- Downloads
duration: Fix comparison functions
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.
Please register or sign in to comment