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

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

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8, 3.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Minor Change

      __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

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

              Created:
              Updated:
              Resolved: