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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 2.8, 3.0
    • None
    • None
    • Minor Change

    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

            jesse@mongodb.com A. Jesse Jiryu Davis
            dmitchell@edx.org Don Mitchell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: