Skip to content

Commit 383fb55

Browse files
authored
Add typing to ScopeConsumer (#5680)
1 parent 4a6b6bf commit 383fb55

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

pylint/checkers/variables.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,18 @@
6363
import sys
6464
from enum import Enum
6565
from functools import lru_cache
66-
from typing import TYPE_CHECKING, Any, DefaultDict, List, Optional, Set, Tuple, Union
66+
from typing import (
67+
TYPE_CHECKING,
68+
Any,
69+
DefaultDict,
70+
Dict,
71+
List,
72+
NamedTuple,
73+
Optional,
74+
Set,
75+
Tuple,
76+
Union,
77+
)
6778

6879
import astroid
6980
from astroid import nodes
@@ -536,9 +547,13 @@ def _has_locals_call_after_node(stmt, scope):
536547
}
537548

538549

539-
ScopeConsumer = collections.namedtuple(
540-
"ScopeConsumer", "to_consume consumed consumed_uncertain scope_type"
541-
)
550+
class ScopeConsumer(NamedTuple):
551+
"""Store nodes and their consumption states."""
552+
553+
to_consume: Dict[str, List[nodes.NodeNG]]
554+
consumed: Dict[str, List[nodes.NodeNG]]
555+
consumed_uncertain: DefaultDict[str, List[nodes.NodeNG]]
556+
scope_type: str
542557

543558

544559
class NamesConsumer:

0 commit comments

Comments
 (0)