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

common.BaseObject should be immutable

    XMLWordPrintableJSON

Details

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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: