TypeVar#

class astroid.nodes.TypeVar(lineno: int, col_offset: int, parent: NodeNG, *, end_lineno: int, end_col_offset: int)[source]#

Bases: AssignTypeNode

Class representing a ast.TypeVar node.

>>> import astroid
>>> node = astroid.extract_node('type Point[T] = tuple[float, float]')
>>> node.type_params[0]
<TypeVar l.1 at 0x7f23b2e4e198>
assigned_stmts(**kwargs: _P.kwargs) Generator[InferenceResult, None, None]#

Returns the assigned statement (non inferred) according to the assignment type. See astroid/protocols.py for actual implementation.

bound: NodeNG | None#
name: AssignName#
postinit(*, name: AssignName, bound: NodeNG | None) None[source]#