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

__copy__ and __deepcopy__ should call logic from .clone() on cursors?

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.4
    • Affects Version/s: 2.3
    • Component/s: None
    • Labels:
    • Fully Compatible

      Currently, the .clone() method is the only way to duplicate a cursor by its value, which can be especially useful for handing like cursors off to concurrent threads of execution.

      The copy core module in python is a commonly accepted convention for duplicating objects for these kinds of use cases. Unfortunately, without the _copy_ and _deepcopy_ methods implemented, cursors cannot be duplicated following this convention without an explicit call to .clone()

      To keep the typical python convention, couldn't these methods be implemented to return the same prototype as the clone method?

            ross@mongodb.com Ross Lawley
            deacondesperado Mark Grey
            0 Vote for this issue
            4 Start watching this issue