class documentation

class AsStringVisitor: (source)

View In Hierarchy

Visitor to render an Astroid node as a valid python code string

Static Method visit_matchsingleton Return an astroid.MatchSingleton node as string.
Method __call__ Makes this visitor behave as a simple function
Method __init__ Undocumented
Method handle_functiondef return a (possibly async) function definition node as string
Method visit_annassign Return an astroid.AugAssign node as string
Method visit_arguments return an astroid.Function node as string
Method visit_assert return an astroid.Assert node as string
Method visit_assign return an astroid.Assign node as string
Method visit_assignattr return an astroid.AssAttr node as string
Method visit_assignname return an astroid.AssName node as string
Method visit_asyncfor Undocumented
Method visit_asyncfunctiondef return an astroid.AsyncFunction node as string
Method visit_asyncwith Undocumented
Method visit_attribute return an astroid.Getattr node as string
Method visit_augassign return an astroid.AugAssign node as string
Method visit_await Undocumented
Method visit_binop return an astroid.BinOp node as string
Method visit_boolop return an astroid.BoolOp node as string
Method visit_break return an astroid.Break node as string
Method visit_call return an astroid.Call node as string
Method visit_classdef return an astroid.ClassDef node as string
Method visit_compare return an astroid.Compare node as string
Method visit_comprehension return an astroid.Comprehension node as string
Method visit_const return an astroid.Const node as string
Method visit_continue return an astroid.Continue node as string
Method visit_decorators return an astroid.Decorators node as string
Method visit_delattr return an astroid.DelAttr node as string
Method visit_delete return an astroid.Delete node as string
Method visit_delname return an astroid.DelName node as string
Method visit_dict return an astroid.Dict node as string
Method visit_dictcomp return an astroid.DictComp node as string
Method visit_dictunpack Undocumented
Method visit_empty return an Empty node as string
Method visit_emptynode dummy method for visiting an Empty node
Method visit_evaluatedobject Undocumented
Method visit_excepthandler Undocumented
Method visit_expr return an astroid.Discard node as string
Method visit_for return an astroid.For node as string
Method visit_formattedvalue Undocumented
Method visit_frozenset Undocumented
Method visit_functiondef return an astroid.FunctionDef node as string
Method visit_generatorexp return an astroid.GeneratorExp node as string
Method visit_global return an astroid.Global node as string
Method visit_if return an astroid.If node as string
Method visit_ifexp return an astroid.IfExp node as string
Method visit_import return an astroid.Import node as string
Method visit_importfrom return an astroid.ImportFrom node as string
Method visit_joinedstr Undocumented
Method visit_keyword return an astroid.Keyword node as string
Method visit_lambda return an astroid.Lambda node as string
Method visit_list return an astroid.List node as string
Method visit_listcomp return an astroid.ListComp node as string
Method visit_match Return an astroid.Match node as string.
Method visit_matchas Return an astroid.MatchAs node as string.
Method visit_matchcase Return an astroid.MatchCase node as string.
Method visit_matchclass Return an astroid.MatchClass node as string.
Method visit_matchmapping Return an astroid.MatchMapping node as string.
Method visit_matchor Return an astroid.MatchOr node as string.
Method visit_matchsequence Return an astroid.MatchSequence node as string.
Method visit_matchstar Return an astroid.MatchStar node as string.
Method visit_matchvalue Return an astroid.MatchValue node as string.
Method visit_module return an astroid.Module node as string
Method visit_name return an astroid.Name node as string
Method visit_namedexpr Return an assignment expression node as string
Method visit_nonlocal return an astroid.Nonlocal node as string
Method visit_pass return an astroid.Pass node as string
Method visit_property Undocumented
Method visit_raise return an astroid.Raise node as string
Method visit_return return an astroid.Return node as string
Method visit_set return an astroid.Set node as string
Method visit_setcomp return an astroid.SetComp node as string
Method visit_slice return an astroid.Slice node as string
Method visit_starred return Starred node as string
Method visit_subscript return an astroid.Subscript node as string
Method visit_super Undocumented
Method visit_tryexcept return an astroid.TryExcept node as string
Method visit_tryfinally return an astroid.TryFinally node as string
Method visit_tuple return an astroid.Tuple node as string
Method visit_unaryop return an astroid.UnaryOp node as string
Method visit_uninferable Undocumented
Method visit_unknown Undocumented
Method visit_while return an astroid.While node as string
Method visit_with return an astroid.With node as string
Method visit_yield yield an ast.Yield node as string
Method visit_yieldfrom Return an astroid.YieldFrom node as string.
Instance Variable indent Undocumented
Method _docs_dedent Stop newlines in docs being indented by self._stmt_list
Method _precedence_parens Wrap child in parens only if required to keep same semantics
Method _should_wrap Wrap child if: - it has lower precedence - same precedence with position opposite to associativity direction
Method _stmt_list return a list of nodes to string
Method _visit_dict Undocumented
@staticmethod
def visit_matchsingleton(node: MatchSingleton) -> str: (source)

Return an astroid.MatchSingleton node as string.

def __call__(self, node) -> str: (source)

Makes this visitor behave as a simple function

def __init__(self, indent: str = ' '): (source)

Undocumented

def handle_functiondef(self, node, keyword) -> str: (source)

return a (possibly async) function definition node as string

def visit_annassign(self, node) -> str: (source)

Return an astroid.AugAssign node as string

def visit_arguments(self, node) -> str: (source)

return an astroid.Function node as string

def visit_assert(self, node) -> str: (source)

return an astroid.Assert node as string

def visit_assign(self, node) -> str: (source)

return an astroid.Assign node as string

def visit_assignattr(self, node) -> str: (source)

return an astroid.AssAttr node as string

def visit_assignname(self, node) -> str: (source)

return an astroid.AssName node as string

def visit_asyncfor(self, node) -> str: (source)

Undocumented

def visit_asyncfunctiondef(self, node) -> str: (source)

return an astroid.AsyncFunction node as string

def visit_asyncwith(self, node) -> str: (source)

Undocumented

def visit_attribute(self, node) -> str: (source)

return an astroid.Getattr node as string

def visit_augassign(self, node) -> str: (source)

return an astroid.AugAssign node as string

def visit_await(self, node) -> str: (source)

Undocumented

def visit_binop(self, node) -> str: (source)

return an astroid.BinOp node as string

def visit_boolop(self, node) -> str: (source)

return an astroid.BoolOp node as string

def visit_break(self, node) -> str: (source)

return an astroid.Break node as string

def visit_call(self, node) -> str: (source)

return an astroid.Call node as string

def visit_classdef(self, node) -> str: (source)

return an astroid.ClassDef node as string

def visit_compare(self, node) -> str: (source)

return an astroid.Compare node as string

def visit_comprehension(self, node) -> str: (source)

return an astroid.Comprehension node as string

def visit_const(self, node) -> str: (source)

return an astroid.Const node as string

def visit_continue(self, node) -> str: (source)

return an astroid.Continue node as string

def visit_decorators(self, node) -> str: (source)

return an astroid.Decorators node as string

def visit_delattr(self, node) -> str: (source)

return an astroid.DelAttr node as string

def visit_delete(self, node) -> str: (source)

return an astroid.Delete node as string

def visit_delname(self, node) -> str: (source)

return an astroid.DelName node as string

def visit_dict(self, node) -> str: (source)

return an astroid.Dict node as string

def visit_dictcomp(self, node) -> str: (source)

return an astroid.DictComp node as string

def visit_dictunpack(self, node) -> str: (source)

Undocumented

def visit_empty(self, node) -> str: (source)

return an Empty node as string

def visit_emptynode(self, node) -> str: (source)

dummy method for visiting an Empty node

def visit_evaluatedobject(self, node): (source)

Undocumented

def visit_excepthandler(self, node) -> str: (source)

Undocumented

def visit_expr(self, node) -> str: (source)

return an astroid.Discard node as string

def visit_for(self, node) -> str: (source)

return an astroid.For node as string

def visit_formattedvalue(self, node) -> str: (source)

Undocumented

def visit_frozenset(self, node): (source)

Undocumented

def visit_functiondef(self, node) -> str: (source)

return an astroid.FunctionDef node as string

def visit_generatorexp(self, node) -> str: (source)

return an astroid.GeneratorExp node as string

def visit_global(self, node) -> str: (source)

return an astroid.Global node as string

def visit_if(self, node) -> str: (source)

return an astroid.If node as string

def visit_ifexp(self, node) -> str: (source)

return an astroid.IfExp node as string

def visit_import(self, node) -> str: (source)

return an astroid.Import node as string

def visit_importfrom(self, node) -> str: (source)

return an astroid.ImportFrom node as string

def visit_joinedstr(self, node) -> str: (source)

Undocumented

def visit_keyword(self, node) -> str: (source)

return an astroid.Keyword node as string

def visit_lambda(self, node) -> str: (source)

return an astroid.Lambda node as string

def visit_list(self, node) -> str: (source)

return an astroid.List node as string

def visit_listcomp(self, node) -> str: (source)

return an astroid.ListComp node as string

def visit_match(self, node: Match) -> str: (source)

Return an astroid.Match node as string.

def visit_matchas(self, node: MatchAs) -> str: (source)

Return an astroid.MatchAs node as string.

def visit_matchcase(self, node: MatchCase) -> str: (source)

Return an astroid.MatchCase node as string.

def visit_matchclass(self, node: MatchClass) -> str: (source)

Return an astroid.MatchClass node as string.

def visit_matchmapping(self, node: MatchMapping) -> str: (source)

Return an astroid.MatchMapping node as string.

def visit_matchor(self, node: MatchOr) -> str: (source)

Return an astroid.MatchOr node as string.

def visit_matchsequence(self, node: MatchSequence) -> str: (source)

Return an astroid.MatchSequence node as string.

def visit_matchstar(self, node: MatchStar) -> str: (source)

Return an astroid.MatchStar node as string.

def visit_matchvalue(self, node: MatchValue) -> str: (source)

Return an astroid.MatchValue node as string.

def visit_module(self, node) -> str: (source)

return an astroid.Module node as string

def visit_name(self, node) -> str: (source)

return an astroid.Name node as string

def visit_namedexpr(self, node) -> str: (source)

Return an assignment expression node as string

def visit_nonlocal(self, node) -> str: (source)

return an astroid.Nonlocal node as string

def visit_pass(self, node) -> str: (source)

return an astroid.Pass node as string

def visit_property(self, node): (source)

Undocumented

def visit_raise(self, node) -> str: (source)

return an astroid.Raise node as string

def visit_return(self, node) -> str: (source)

return an astroid.Return node as string

def visit_set(self, node) -> str: (source)

return an astroid.Set node as string

def visit_setcomp(self, node) -> str: (source)

return an astroid.SetComp node as string

def visit_slice(self, node) -> str: (source)

return an astroid.Slice node as string

def visit_starred(self, node) -> str: (source)

return Starred node as string

def visit_subscript(self, node) -> str: (source)

return an astroid.Subscript node as string

def visit_super(self, node): (source)

Undocumented

def visit_tryexcept(self, node) -> str: (source)

return an astroid.TryExcept node as string

def visit_tryfinally(self, node) -> str: (source)

return an astroid.TryFinally node as string

def visit_tuple(self, node) -> str: (source)

return an astroid.Tuple node as string

def visit_unaryop(self, node) -> str: (source)

return an astroid.UnaryOp node as string

def visit_uninferable(self, node): (source)

Undocumented

def visit_unknown(self, node: Unknown) -> str: (source)

Undocumented

def visit_while(self, node) -> str: (source)

return an astroid.While node as string

def visit_with(self, node) -> str: (source)

return an astroid.With node as string

def visit_yield(self, node) -> str: (source)

yield an ast.Yield node as string

def visit_yieldfrom(self, node) -> str: (source)

Return an astroid.YieldFrom node as string.

Undocumented

def _docs_dedent(self, doc_node: Const|None) -> str: (source)

Stop newlines in docs being indented by self._stmt_list

def _precedence_parens(self, node, child, is_left: bool = True) -> str: (source)

Wrap child in parens only if required to keep same semantics

def _should_wrap(self, node, child, is_left: bool) -> bool: (source)

Wrap child if: - it has lower precedence - same precedence with position opposite to associativity direction

def _stmt_list(self, stmts: list, indent: bool = True) -> str: (source)

return a list of nodes to string

def _visit_dict(self, node) -> Iterator[str]: (source)

Undocumented