Skip to content

Commit 20d2a2d

Browse files
committed
Expand on comment
1 parent e52dc55 commit 20d2a2d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/shapefile.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,8 +2102,8 @@ def __getitem__(
21022102
:return: the value of the field
21032103
"""
21042104
try:
2105-
# Using | on types in Python 3.9 also raises TypeError, so Union needed.
2106-
# as we subsequently catch TypeError
2105+
# Using | on types in Python 3.9 also raises TypeError, so
2106+
# Union is needed, as we subsequently catch TypeError.
21072107
return list.__getitem__(self, cast(Union[SupportsIndex, slice], item))
21082108
except TypeError:
21092109
try:
@@ -2134,8 +2134,6 @@ def __setitem__(
21342134
:param key: Either the position of the value or the name of a field
21352135
:param value: the new value of the field
21362136
"""
2137-
# Using | on types in Python 3.9 also raises TypeError, so Union needed.
2138-
# as we subsequently catch TypeError
21392137
ValidKVTuple = Union[
21402138
tuple[SupportsIndex, RecordValue], tuple[slice, Iterable[RecordValue]]
21412139
]

0 commit comments

Comments
 (0)