Skip to content

Commit

Permalink
PYTHON-3124 Remove overlapping slots from _WriteResult subclasses (mo…
Browse files Browse the repository at this point in the history
  • Loading branch information
ariebovenberg authored and blink1073 committed Feb 25, 2022
1 parent 40466ce commit 56c6e9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions doc/contributors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ The following is a list of people who have contributed to
- Khanh Nguyen (KN99HN)
- Henri Froese (henrifroese)
- Ishmum Jawad Khan (ishmum123)
- Arie Bovenberg (ariebovenberg)
10 changes: 5 additions & 5 deletions pymongo/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def acknowledged(self) -> bool:
class InsertOneResult(_WriteResult):
"""The return type for :meth:`~pymongo.collection.Collection.insert_one`."""

__slots__ = ("__inserted_id", "__acknowledged")
__slots__ = ("__inserted_id",)

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

__slots__ = ("__inserted_ids", "__acknowledged")
__slots__ = ("__inserted_ids",)

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

__slots__ = ("__raw_result", "__acknowledged")
__slots__ = ("__raw_result",)

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

__slots__ = ("__raw_result", "__acknowledged")
__slots__ = ("__raw_result",)

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

__slots__ = ("__bulk_api_result", "__acknowledged")
__slots__ = ("__bulk_api_result",)

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

0 comments on commit 56c6e9d

Please sign in to comment.