class documentation

class VariableCommentPicker(ast.NodeVisitor): (source)

View In Hierarchy

Python source code parser to pick up variable comments.

Method __init__ Undocumented
Method add_entry Undocumented
Method add_final_entry Undocumented
Method add_overload_entry Undocumented
Method add_variable_annotation Undocumented
Method add_variable_comment Undocumented
Method get_line Returns specified line.
Method get_qualname_for Get qualified name for given object as a list of string(s).
Method get_self Returns the name of the first argument if in a function.
Method is_final Undocumented
Method is_overload Undocumented
Method visit Updates self.previous to the given node.
Method visit_AnnAssign Handles AnnAssign node and pick up a variable comment.
Method visit_Assign Handles Assign node and pick up a variable comment.
Method visit_AsyncFunctionDef Handles AsyncFunctionDef node and set context.
Method visit_ClassDef Handles ClassDef node and set context.
Method visit_Expr Handles Expr node and pick up a comment if string.
Method visit_FunctionDef Handles FunctionDef node and set context.
Method visit_Import Handles Import node and record the order of definitions.
Method visit_ImportFrom Handles Import node and record the order of definitions.
Method visit_Try Handles Try node and processes body and else-clause.
Instance Variable annotations Undocumented
Instance Variable buffers Undocumented
Instance Variable comments Undocumented
Instance Variable context Undocumented
Instance Variable counter Undocumented
Instance Variable current_classes Undocumented
Instance Variable current_function Undocumented
Instance Variable deforders Undocumented
Instance Variable encoding Undocumented
Instance Variable finals Undocumented
Instance Variable overloads Undocumented
Instance Variable previous Undocumented
Instance Variable typing Undocumented
Instance Variable typing_final Undocumented
Instance Variable typing_overload Undocumented
def __init__(self, buffers, encoding): (source)

Undocumented

Parameters
buffers:list[str]Undocumented
encoding:strUndocumented
def add_entry(self, name): (source)

Undocumented

Parameters
name:strUndocumented
def add_final_entry(self, name): (source)

Undocumented

Parameters
name:strUndocumented
def add_overload_entry(self, func): (source)

Undocumented

Parameters
func:ast.FunctionDefUndocumented
def add_variable_annotation(self, name, annotation): (source)

Undocumented

Parameters
name:strUndocumented
annotation:ast.ASTUndocumented
def add_variable_comment(self, name, comment): (source)

Undocumented

Parameters
name:strUndocumented
comment:strUndocumented
def get_line(self, lineno): (source)

Returns specified line.

Parameters
lineno:intUndocumented
Returns
strUndocumented
def get_qualname_for(self, name): (source)

Get qualified name for given object as a list of string(s).

Parameters
name:strUndocumented
Returns
list[str]|NoneUndocumented
def get_self(self): (source)

Returns the name of the first argument if in a function.

Returns
ast.arg|NoneUndocumented
def is_final(self, decorators): (source)

Undocumented

Parameters
decorators:list[ast.expr]Undocumented
Returns
boolUndocumented
def is_overload(self, decorators): (source)

Undocumented

Parameters
decorators:list[ast.expr]Undocumented
Returns
boolUndocumented
def visit(self, node): (source)

Updates self.previous to the given node.

Parameters
node:ast.ASTUndocumented
def visit_AnnAssign(self, node): (source)

Handles AnnAssign node and pick up a variable comment.

Parameters
node:ast.AnnAssignUndocumented
def visit_Assign(self, node): (source)

Handles Assign node and pick up a variable comment.

Parameters
node:ast.AssignUndocumented
def visit_AsyncFunctionDef(self, node): (source)

Handles AsyncFunctionDef node and set context.

Parameters
node:ast.AsyncFunctionDefUndocumented
def visit_ClassDef(self, node): (source)

Handles ClassDef node and set context.

Parameters
node:ast.ClassDefUndocumented
def visit_Expr(self, node): (source)

Handles Expr node and pick up a comment if string.

Parameters
node:ast.ExprUndocumented
def visit_FunctionDef(self, node): (source)

Handles FunctionDef node and set context.

Parameters
node:ast.FunctionDefUndocumented
def visit_Import(self, node): (source)

Handles Import node and record the order of definitions.

Parameters
node:ast.ImportUndocumented
def visit_ImportFrom(self, node): (source)

Handles Import node and record the order of definitions.

Parameters
node:ast.ImportFromUndocumented
def visit_Try(self, node): (source)

Handles Try node and processes body and else-clause. .. note:: pycode parser ignores objects definition in except-clause.

Parameters
node:ast.TryUndocumented
annotations: dict[tuple[str, str], str] = (source)

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

current_classes: list[str] = (source)

Undocumented

current_function = (source)

Undocumented

deforders: dict[str, int] = (source)

Undocumented

encoding = (source)

Undocumented

Undocumented

Undocumented

previous = (source)

Undocumented

Undocumented

typing_final = (source)

Undocumented

typing_overload: str|None = (source)

Undocumented