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): (source)
Return an astroid.MatchSingleton node as string.
Parameters
node:MatchSingletonUndocumented
Returns
strUndocumented
def __call__(self, node): (source)
Makes this visitor behave as a simple function
def __init__(self, indent=' '): (source)

Undocumented

def handle_functiondef(self, node, keyword): (source)
return a (possibly async) function definition node as string
def visit_annassign(self, node): (source)
Return an astroid.AugAssign node as string
def visit_arguments(self, node): (source)
return an astroid.Function node as string
def visit_assert(self, node): (source)
return an astroid.Assert node as string
def visit_assign(self, node): (source)
return an astroid.Assign node as string
def visit_assignattr(self, node): (source)
return an astroid.AssAttr node as string
def visit_assignname(self, node): (source)
return an astroid.AssName node as string
def visit_asyncfor(self, node): (source)

Undocumented

def visit_asyncfunctiondef(self, node): (source)
return an astroid.AsyncFunction node as string
def visit_asyncwith(self, node): (source)

Undocumented

def visit_attribute(self, node): (source)
return an astroid.Getattr node as string
def visit_augassign(self, node): (source)
return an astroid.AugAssign node as string
def visit_await(self, node): (source)

Undocumented

def visit_binop(self, node): (source)
return an astroid.BinOp node as string
def visit_boolop(self, node): (source)
return an astroid.BoolOp node as string
def visit_break(self, node): (source)
return an astroid.Break node as string
def visit_call(self, node): (source)
return an astroid.Call node as string
def visit_classdef(self, node): (source)
return an astroid.ClassDef node as string
def visit_compare(self, node): (source)
return an astroid.Compare node as string
def visit_comprehension(self, node): (source)
return an astroid.Comprehension node as string
def visit_const(self, node): (source)
return an astroid.Const node as string
def visit_continue(self, node): (source)
return an astroid.Continue node as string
def visit_decorators(self, node): (source)
return an astroid.Decorators node as string
def visit_delattr(self, node): (source)
return an astroid.DelAttr node as string
def visit_delete(self, node): (source)
return an astroid.Delete node as string
def visit_delname(self, node): (source)
return an astroid.DelName node as string
def visit_dict(self, node): (source)
return an astroid.Dict node as string
def visit_dictcomp(self, node): (source)
return an astroid.DictComp node as string
def visit_dictunpack(self, node): (source)

Undocumented

def visit_empty(self, node): (source)
return an Empty node as string
def visit_emptynode(self, node): (source)
dummy method for visiting an Empty node
def visit_evaluatedobject(self, node): (source)

Undocumented

def visit_excepthandler(self, node): (source)

Undocumented

def visit_expr(self, node): (source)
return an astroid.Discard node as string
def visit_for(self, node): (source)
return an astroid.For node as string
def visit_formattedvalue(self, node): (source)

Undocumented

def visit_frozenset(self, node): (source)

Undocumented

def visit_functiondef(self, node): (source)
return an astroid.FunctionDef node as string
def visit_generatorexp(self, node): (source)
return an astroid.GeneratorExp node as string
def visit_global(self, node): (source)
return an astroid.Global node as string
def visit_if(self, node): (source)
return an astroid.If node as string
def visit_ifexp(self, node): (source)
return an astroid.IfExp node as string
def visit_import(self, node): (source)
return an astroid.Import node as string
def visit_importfrom(self, node): (source)
return an astroid.ImportFrom node as string
def visit_joinedstr(self, node): (source)

Undocumented

def visit_keyword(self, node): (source)
return an astroid.Keyword node as string
def visit_lambda(self, node): (source)
return an astroid.Lambda node as string
def visit_list(self, node): (source)
return an astroid.List node as string
def visit_listcomp(self, node): (source)
return an astroid.ListComp node as string
def visit_match(self, node): (source)
Return an astroid.Match node as string.
Parameters
node:MatchUndocumented
Returns
strUndocumented
def visit_matchas(self, node): (source)
Return an astroid.MatchAs node as string.
Parameters
node:MatchAsUndocumented
Returns
strUndocumented
def visit_matchcase(self, node): (source)
Return an astroid.MatchCase node as string.
Parameters
node:MatchCaseUndocumented
Returns
strUndocumented
def visit_matchclass(self, node): (source)
Return an astroid.MatchClass node as string.
Parameters
node:MatchClassUndocumented
Returns
strUndocumented
def visit_matchmapping(self, node): (source)
Return an astroid.MatchMapping node as string.
Parameters
node:MatchMappingUndocumented
Returns
strUndocumented
def visit_matchor(self, node): (source)
Return an astroid.MatchOr node as string.
Parameters
node:MatchOrUndocumented
Returns
strUndocumented
def visit_matchsequence(self, node): (source)
Return an astroid.MatchSequence node as string.
Parameters
node:MatchSequenceUndocumented
Returns
strUndocumented
def visit_matchstar(self, node): (source)
Return an astroid.MatchStar node as string.
Parameters
node:MatchStarUndocumented
Returns
strUndocumented
def visit_matchvalue(self, node): (source)
Return an astroid.MatchValue node as string.
Parameters
node:MatchValueUndocumented
Returns
strUndocumented
def visit_module(self, node): (source)
return an astroid.Module node as string
def visit_name(self, node): (source)
return an astroid.Name node as string
def visit_namedexpr(self, node): (source)
Return an assignment expression node as string
def visit_nonlocal(self, node): (source)
return an astroid.Nonlocal node as string
def visit_pass(self, node): (source)
return an astroid.Pass node as string
def visit_property(self, node): (source)

Undocumented

def visit_raise(self, node): (source)
return an astroid.Raise node as string
def visit_return(self, node): (source)
return an astroid.Return node as string
def visit_set(self, node): (source)
return an astroid.Set node as string
def visit_setcomp(self, node): (source)
return an astroid.SetComp node as string
def visit_slice(self, node): (source)
return an astroid.Slice node as string
def visit_starred(self, node): (source)
return Starred node as string
def visit_subscript(self, node): (source)
return an astroid.Subscript node as string
def visit_super(self, node): (source)

Undocumented

def visit_tryexcept(self, node): (source)
return an astroid.TryExcept node as string
def visit_tryfinally(self, node): (source)
return an astroid.TryFinally node as string
def visit_tuple(self, node): (source)
return an astroid.Tuple node as string
def visit_unaryop(self, node): (source)
return an astroid.UnaryOp node as string
def visit_uninferable(self, node): (source)

Undocumented

def visit_unknown(self, node): (source)

Undocumented

Parameters
node:UnknownUndocumented
Returns
strUndocumented
def visit_while(self, node): (source)
return an astroid.While node as string
def visit_with(self, node): (source)
return an astroid.With node as string
def visit_yield(self, node): (source)
yield an ast.Yield node as string
def visit_yieldfrom(self, node): (source)
Return an astroid.YieldFrom node as string.
indent = (source)

Undocumented

def _docs_dedent(self, doc): (source)
Stop newlines in docs being indented by self._stmt_list
def _precedence_parens(self, node, child, is_left=True): (source)
Wrap child in parens only if required to keep same semantics
def _should_wrap(self, node, child, is_left): (source)
Wrap child if: - it has lower precedence - same precedence with position opposite to associativity direction
def _stmt_list(self, stmts, indent=True): (source)
return a list of nodes to string
def _visit_dict(self, node): (source)

Undocumented