Skip to content

Commit 90ab512

Browse files
committed
Replace namedtuple with typing.NamedTuple
1 parent c21753b commit 90ab512

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

bpython/line.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@
55
word."""
66

77
from itertools import chain
8-
from collections import namedtuple
9-
from typing import Optional
8+
from typing import Optional, NamedTuple
109

1110
from .lazyre import LazyReCompile
1211

13-
LinePart = namedtuple("LinePart", ["start", "stop", "word"])
12+
13+
class LinePart(NamedTuple):
14+
start: int
15+
stop: int
16+
word: str
17+
18+
1419
_current_word_re = LazyReCompile(r"(?<![)\]\w_.])" r"([\w_][\w0-9._]*[(]?)")
1520

1621

0 commit comments

Comments
 (0)