Skip to content

Commit 2f13a51

Browse files
PYTHON-3124 Remove overlapping slots from _WriteResult subclasses (#884)
1 parent 52ff8c2 commit 2f13a51

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

doc/contributors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,4 @@ The following is a list of people who have contributed to
9191
- Khanh Nguyen (KN99HN)
9292
- Henri Froese (henrifroese)
9393
- Ishmum Jawad Khan (ishmum123)
94+
- Arie Bovenberg (ariebovenberg)

pymongo/results.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def acknowledged(self) -> bool:
5959
class InsertOneResult(_WriteResult):
6060
"""The return type for :meth:`~pymongo.collection.Collection.insert_one`."""
6161

62-
__slots__ = ("__inserted_id", "__acknowledged")
62+
__slots__ = ("__inserted_id",)
6363

6464
def __init__(self, inserted_id: Any, acknowledged: bool) -> None:
6565
self.__inserted_id = inserted_id
@@ -74,7 +74,7 @@ def inserted_id(self) -> Any:
7474
class InsertManyResult(_WriteResult):
7575
"""The return type for :meth:`~pymongo.collection.Collection.insert_many`."""
7676

77-
__slots__ = ("__inserted_ids", "__acknowledged")
77+
__slots__ = ("__inserted_ids",)
7878

7979
def __init__(self, inserted_ids: List[Any], acknowledged: bool) -> None:
8080
self.__inserted_ids = inserted_ids
@@ -98,7 +98,7 @@ class UpdateResult(_WriteResult):
9898
:meth:`~pymongo.collection.Collection.replace_one`.
9999
"""
100100

101-
__slots__ = ("__raw_result", "__acknowledged")
101+
__slots__ = ("__raw_result",)
102102

103103
def __init__(self, raw_result: Dict[str, Any], acknowledged: bool) -> None:
104104
self.__raw_result = raw_result
@@ -136,7 +136,7 @@ class DeleteResult(_WriteResult):
136136
"""The return type for :meth:`~pymongo.collection.Collection.delete_one`
137137
and :meth:`~pymongo.collection.Collection.delete_many`"""
138138

139-
__slots__ = ("__raw_result", "__acknowledged")
139+
__slots__ = ("__raw_result",)
140140

141141
def __init__(self, raw_result: Dict[str, Any], acknowledged: bool) -> None:
142142
self.__raw_result = raw_result
@@ -157,7 +157,7 @@ def deleted_count(self) -> int:
157157
class BulkWriteResult(_WriteResult):
158158
"""An object wrapper for bulk API write results."""
159159

160-
__slots__ = ("__bulk_api_result", "__acknowledged")
160+
__slots__ = ("__bulk_api_result",)
161161

162162
def __init__(self, bulk_api_result: Dict[str, Any], acknowledged: bool) -> None:
163163
"""Create a BulkWriteResult instance.

0 commit comments

Comments
 (0)