Skip to content

Commit 304c87c

Browse files
Use a NamedTuple from typing directly
1 parent 5e723a7 commit 304c87c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pylint/testutils/output_line.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# For details: https://github.com/PyCQA/pylint/blob/master/LICENSE
33

44
import collections
5+
from typing import Any, NamedTuple
56

67
from pylint import interfaces
78
from pylint.constants import PY38_PLUS
@@ -54,11 +55,14 @@ def __init__(self, row, exception):
5455
Exception.__init__(self, msg)
5556

5657

57-
class OutputLine(
58-
collections.namedtuple(
59-
"OutputLine", ["symbol", "lineno", "column", "object", "msg", "confidence"]
60-
)
61-
):
58+
class OutputLine(NamedTuple):
59+
symbol: str
60+
lineno: int
61+
column: int
62+
object: Any
63+
msg: str
64+
confidence: str
65+
6266
@classmethod
6367
def from_msg(cls, msg):
6468
column = cls.get_column(msg.column)

0 commit comments

Comments
 (0)