Skip to content

Commit 657c511

Browse files
committed
PYTHON-821 - Improve docs for write result acknowledged attribute.
1 parent ca95df4 commit 657c511

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

pymongo/results.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,21 @@ def _raise_if_unacknowledged(self, property_name):
3333

3434
@property
3535
def acknowledged(self):
36-
"""Is this the result of an acknowledged write operation?"""
36+
"""Is this the result of an acknowledged write operation?
37+
38+
The :attr:`acknowledged` attribute will be ``False`` when using
39+
``WriteConcern(w=0)``, otherwise ``True``.
40+
41+
.. note::
42+
If the :attr:`acknowledged` attribute is ``False`` all other
43+
attibutes of this class will raise
44+
:class:`~pymongo.errors.InvalidOperation` when accessed. Values for
45+
other attributes cannot be determined if the write operation was
46+
unacknowledged.
47+
48+
.. seealso::
49+
:class:`~pymongo.write_concern.WriteConcern`
50+
"""
3751
return self.__acknowledged
3852

3953

0 commit comments

Comments
 (0)