Skip to content
Snippets Groups Projects
  • Daniele Nicolodi's avatar
    8c011f88
    duration: Fix comparison functions · 8c011f88
    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.
    8c011f88
    History
    duration: Fix comparison functions
    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.
SelectRenderer.js 263 B