From 648e5beabb2e4956c824f13c4f22c2cf57484af9 Mon Sep 17 00:00:00 2001 From: Bernie Hackett Date: Thu, 19 Mar 2015 10:20:03 -0700 Subject: [PATCH] PYTHON-677 - Really make WriteConcern immutable. --- pymongo/write_concern.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pymongo/write_concern.py b/pymongo/write_concern.py index 2f4f83973..e986244af 100644 --- a/pymongo/write_concern.py +++ b/pymongo/write_concern.py @@ -82,8 +82,12 @@ class WriteConcern(object): @property def document(self): """The document representation of this write concern. + + .. note:: + :class:`WriteConcern` is immutable. Mutating the value of + :attr:`document` does not mutate this :class:`WriteConcern`. """ - return self.__document + return self.__document.copy() @property def acknowledged(self):