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

common.BaseObject should be immutable

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

      Currently MongoClient, Database, and Collection can be mutated through the BaseObject attributes read_preference, write_concern, uuid_subtype, etc. This is leading to problems in applications where different threads apply conflicting changes to the same object (reports of buggy applications like this are increasing).

      PyMongo 3 will make instances of these attributes immutable. The existing attributes will become read only, uuid_subtype will be removed with its functionality folded into a CodecOptions class, tag_sets will be removed with its functionality folded into read preference, and a new API will be provided to create Database and Collection instances with explicit CodecOptions, ReadPreference, and WriteConcern.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: