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

Implement ordering on MinKey / MaxKey

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 2.7
    • None
    • None

    Description

      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()

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: