Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-604

Implement ordering on MinKey / MaxKey

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.7
    • Affects Version/s: None
    • Component/s: None
    • None

      For any task that involves inspecting chunk ranges with the Python driver, it would be helpful if MinKey and MaxKey would compare always less than / greater than any other value (this is currently not the case, only __eq__ and __ne__ are implemented).

      Implementation suggestion:

      MinKey.__le__ = lambda self, other: True
      MinKey.__lt__ = lambda self, other: other != MinKey()
      MinKey.__gt__ = lambda self, other: False
      MinKey.__ge__ = lambda self, other: other == MinKey()
      

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            thomas.rueckstiess@mongodb.com Thomas Rueckstiess
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: