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

bson.son.SON should not copy keys for internal operations

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8, 3.0
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change
    • Sprint:
      Python Sprint 8, Python Sprint 9

      Description

      __iter__, has_key, __contains__, clear, & len all copy the __keys list but don't need to.

      Minor backward compatibility change: make __iter__ generate a runtime error if the user attempts to destructively modify the SON during iteration just as dict does and have the others directly use the internal list.

      Fix is in https://github.com/mongodb/mongo-python-driver/pull/238

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: