class documentation

class Context: (source)

Known subclasses: mypy.nodes.Node, mypy.types.Type

View In Hierarchy

Base type for objects that are valid as error message locations.
Method __init__ Undocumented
Method get​_column Don't use. Use x.column.
Method get​_line Don't use. Use x.line.
Method set​_line If target is a node, pull line (and column) information into this node. If column is specified, this will override any column information coming from a node.
Class Variable __slots__ Undocumented
Instance Variable column Undocumented
Instance Variable end​_line Undocumented
Instance Variable line Undocumented
def __init__(self, line=-1, column=-1): (source)
overridden in mypy.nodes.Argument, mypy.nodes.AssertStmt, mypy.nodes.AssignmentExpr, mypy.nodes.AssignmentStmt, mypy.nodes.AwaitExpr, mypy.nodes.BackquoteExpr, mypy.nodes.Block, mypy.nodes.BytesExpr, mypy.nodes.CallExpr, mypy.nodes.CastExpr, mypy.nodes.ClassDef, mypy.nodes.ComparisonExpr, mypy.nodes.ComplexExpr, mypy.nodes.ConditionalExpr, mypy.nodes.Decorator, mypy.nodes.Decorator, mypy.nodes.DelStmt, mypy.nodes.DictExpr, mypy.nodes.DictionaryComprehension, mypy.nodes.EnumCallExpr, mypy.nodes.ExecStmt, mypy.nodes.ExpressionStmt, mypy.nodes.FloatExpr, mypy.nodes.ForStmt, mypy.nodes.FuncBase, mypy.nodes.FuncDef, mypy.nodes.FuncDef, mypy.nodes.GeneratorExpr, mypy.nodes.GlobalDecl, mypy.nodes.IfStmt, mypy.nodes.ImportBase, mypy.nodes.ImportedName, mypy.nodes.IndexExpr, mypy.nodes.IntExpr, mypy.nodes.ListComprehension, mypy.nodes.ListExpr, mypy.nodes.MypyFile, mypy.nodes.NamedTupleExpr, mypy.nodes.NewTypeExpr, mypy.nodes.NonlocalDecl, mypy.nodes.OperatorAssignmentStmt, mypy.nodes.OpExpr, mypy.nodes.OverloadedFuncDef, mypy.nodes.OverloadedFuncDef, mypy.nodes.PlaceholderNode, mypy.nodes.PrintStmt, mypy.nodes.PromoteExpr, mypy.nodes.RaiseStmt, mypy.nodes.RefExpr, mypy.nodes.ReturnStmt, mypy.nodes.RevealExpr, mypy.nodes.SetComprehension, mypy.nodes.SetExpr, mypy.nodes.SliceExpr, mypy.nodes.StarExpr, mypy.nodes.StrExpr, mypy.nodes.SuperExpr, mypy.nodes.TempNode, mypy.nodes.TryStmt, mypy.nodes.TupleExpr, mypy.nodes.TypeAlias, mypy.nodes.TypeAliasExpr, mypy.nodes.TypeApplication, mypy.nodes.TypedDictExpr, mypy.nodes.TypeInfo, mypy.nodes.TypeVarLikeExpr, mypy.nodes.TypeVarLikeExpr, mypy.nodes.UnaryExpr, mypy.nodes.UnicodeExpr, mypy.nodes.Var, mypy.nodes.WhileStmt, mypy.nodes.WithStmt, mypy.nodes.YieldExpr, mypy.nodes.YieldFromExpr, mypy.types.Type

Undocumented

Parameters
line:intUndocumented
column:intUndocumented
def get_column(self): (source)
Don't use. Use x.column.
Returns
intUndocumented
def get_line(self): (source)
Don't use. Use x.line.
Returns
intUndocumented
def set_line(self, target, column=None, end_line=None): (source)
If target is a node, pull line (and column) information into this node. If column is specified, this will override any column information coming from a node.
Parameters
target:Union[Context, int]Undocumented
column:Optional[int]Undocumented
end​_line:Optional[int]Undocumented
__slots__: tuple[str, ...] = (source)

Undocumented

column = (source)
overridden in mypy.nodes.TempNode

Undocumented

end_line = (source)

Undocumented