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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Component/s: None
    • Labels:
    • Backwards Compatibility:
      Fully Compatible

      Description

      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?

        Attachments

          Activity

            People

            Assignee:
            ross.lawley Ross Lawley
            Reporter:
            deacondesperado Mark Grey
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: