Skip to content

Commit eb98759

Browse files
authored
Remove Record.__getslice__ (#1172)
This magic method has been removed in Python 3.0. If you were calling it directly, please use `Record.__getitem__(slice(...))` or simply `record[...]` instead.
1 parent 7154681 commit eb98759

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ See also https://github.com/neo4j/neo4j-python-driver/wiki for a full changelog.
5252
errors.
5353
- It is now the same error raised as when trying to start an explicit transaction while another explicit transaction
5454
is already active.
55+
- Remove deprecated `Record.__getslice__`. This magic method has been removed in Python 3.0.
56+
If you were calling it directly, please use `Record.__getitem__(slice(...))` or simply `record[...]` instead.
5557

5658

5759
## Version 5.28

src/neo4j/_data.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@
3131

3232
from ._codec.hydration import BrokenHydrationObject
3333
from ._conf import iter_items
34-
35-
36-
if t.TYPE_CHECKING:
37-
from typing_extensions import deprecated
38-
else:
39-
from ._meta import deprecated
40-
4134
from ._spatial import Point
4235
from .exceptions import BrokenRecordError
4336
from .graph import (
@@ -150,14 +143,6 @@ def __getitem__( # type: ignore[override]
150143
else:
151144
return self._super_getitem_single(index)
152145

153-
# TODO: 6.0 - remove
154-
@deprecated("This method is deprecated and will be removed in the future.")
155-
def __getslice__(self, start, stop): # noqa: PLW3201 will be removed
156-
key = slice(start, stop)
157-
keys = self.__keys[key]
158-
values = tuple(self)[key]
159-
return self.__class__(zip(keys, values, strict=True))
160-
161146
def get(self, key: str, default: object = None) -> t.Any:
162147
"""
163148
Obtain a value from the record by key.

0 commit comments

Comments
 (0)