ClassAnalyzer
Handsdown API Index / Handsdown / AST Parser / Analyzers / ClassAnalyzer
Auto-generated documentation for handsdown.ast_parser.analyzers.class_analyzer module.
ClassAnalyzer
Show source in class_analyzer.py:11
AST analyzer for ast.ClassDef
records.
Signature
See also
ClassAnalyzer().generic_visit
Show source in class_analyzer.py:170
Do nothing for unknown ast.AST
nodes.
Arguments
node
- AST node.
Signature
ClassAnalyzer().visit_AnnAssign
Show source in class_analyzer.py:141
Parse info about class annotated attribute statements.
Adds new ast.AnnAssign
entry to attribute_nodes
.
Skips assignments with names starting with _
.
Examples
Arguments
node
- AST node.
Signature
ClassAnalyzer().visit_Assign
Show source in class_analyzer.py:101
Parse info about class attribute statements.
Adds new ast.Assign
entry to attribute_nodes
.
Skips assignments to anything pther that a new variable.
Skips multiple assignments.
Skips assignments with names starting with _
.
Examples
class MyClass:
MY_MODULE_ATTR = "value"
my_attr = "value"
# these entries are skipped
_MY_MODULE_ATTR = "value"
multi_attr_1, multi_attr_2 = [1, 2]
my_object.name = "value"
Arguments
node
- AST node.
Signature
ClassAnalyzer().visit_AsyncFunctionDef
Show source in class_analyzer.py:83
Parse info about class asynchronous method statements.
Adds new FunctionRecord
entry to method_records
.
Examples
Arguments
node
- AST node.
Signature
ClassAnalyzer().visit_ClassDef
Show source in class_analyzer.py:23
Entrypoint for the analyzer.
Adds new ast.expr
entry to decorator_nodes
for each node
from node.decorator_list
.
Adds new ast.expr
entry to base_nodes
for each node
from node.bases
.
Visits each node from node.body
list to parse methods.
Examples
Arguments
node
- AST node.
Signature
ClassAnalyzer().visit_FunctionDef
Show source in class_analyzer.py:65
Parse info about class method statements.
Adds new FunctionRecord
entry to method_records
.
Examples
Arguments
node
- AST node.