@@ -2695,6 +2695,52 @@ def _infer_name(self, frame, name):
26952695 return name
26962696
26972697
2698+ class ParamSpec (_base_nodes .AssignTypeNode ):
2699+ """Class representing a :class:`ast.ParamSpec` node.
2700+
2701+ >>> import astroid
2702+ >>> node = astroid.extract_node('type Alias[**P] = Callable[P, int]')
2703+ >>> node.type_params[0]
2704+ <ParamSpec l.1 at 0x7f23b2e4e198>
2705+ """
2706+
2707+ def __init__ (
2708+ self ,
2709+ lineno : int | None = None ,
2710+ col_offset : int | None = None ,
2711+ parent : NodeNG | None = None ,
2712+ * ,
2713+ end_lineno : int | None = None ,
2714+ end_col_offset : int | None = None ,
2715+ ) -> None :
2716+ self .name : str
2717+ super ().__init__ (
2718+ lineno = lineno ,
2719+ col_offset = col_offset ,
2720+ end_lineno = end_lineno ,
2721+ end_col_offset = end_col_offset ,
2722+ parent = parent ,
2723+ )
2724+
2725+ def postinit (self , name : str ) -> None :
2726+ self .name = name
2727+
2728+ assigned_stmts : ClassVar [
2729+ Callable [
2730+ [
2731+ ParamSpec ,
2732+ AssignName ,
2733+ InferenceContext | None ,
2734+ None ,
2735+ ],
2736+ Generator [NodeNG , None , None ],
2737+ ]
2738+ ]
2739+ """Returns the assigned statement (non inferred) according to the assignment type.
2740+ See astroid/protocols.py for actual implementation.
2741+ """
2742+
2743+
26982744class Pass (_base_nodes .NoChildrenNode , _base_nodes .Statement ):
26992745 """Class representing an :class:`ast.Pass` node.
27002746
@@ -3329,7 +3375,7 @@ def __init__(
33293375 end_lineno : int | None = None ,
33303376 end_col_offset : int | None = None ,
33313377 ) -> None :
3332- self .type_params : list [TypeVar ]
3378+ self .type_params : list [TypeVar , ParamSpec ]
33333379 self .value : NodeNG
33343380 super ().__init__ (
33353381 lineno = lineno ,
@@ -3342,7 +3388,7 @@ def __init__(
33423388 def postinit (
33433389 self ,
33443390 * ,
3345- type_params : list [TypeVar ],
3391+ type_params : list [TypeVar , ParamSpec ],
33463392 value : NodeNG ,
33473393 ) -> None :
33483394 self .type_params = type_params
0 commit comments