Skip to content

Commit 3b08e8c

Browse files
committed
Use Optional[]
1 parent 7ec2431 commit 3b08e8c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

machine/punctuation_analysis/text_segment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ def __getitem__(self, key) -> "GraphemeString":
123123
else:
124124
raise TypeError("Indices must be integers or slices")
125125

126-
def _normalize_start_index(self, index: int | None) -> int:
126+
def _normalize_start_index(self, index: Optional[int]) -> int:
127127
if index is None:
128128
return 0
129129
if index < 0:
130130
return len(self) + index
131131
return index
132132

133-
def _normalize_stop_index(self, index: int | None) -> int:
133+
def _normalize_stop_index(self, index: Optional[int]) -> int:
134134
if index is None:
135135
return len(self)
136136
if index < 0:

0 commit comments

Comments
 (0)