Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
3.4, 3.5, 3.6
-
None
-
None
-
Minor Change
Description
Since PYTHON-1101 made the default write concern (WriteConcern()) evaluate to False it is not possible to override a write concern with the default.
>>> client = MongoClient(w="majority")
|
>>> client.write_concern
|
WriteConcern(w=majority)
|
>>> client.get_database("test", write_concern=WriteConcern()).write_concern
|
WriteConcern(w=majority)
|
>>> WriteConcern() or WriteConcern(w='majority')
|
WriteConcern(w=majority)
|
I propose we just remove the __bool__ and __nonzero__ methods as the behavior it causes is not intuitive. This would be a minor change in behavior that I bet no one externally relies on.
Attachments
Issue Links
- is caused by
-
PYTHON-1101 Support sending writeConcern for commands that write
-
- Closed
-
- is depended on by
-
PYTHON-1557 Release PyMongo 3.7
-
- Closed
-