class documentation

class VisitorExt(_BaseVisitor[T]): (source)

Known subclasses: pydoctor.astutils.NodeVisitorExt

Constructor: VisitorExt()

View In Hierarchy

The node visitor extension base class, to inherit from.

Subclasses must define the when class variable, and any custom visit_* methods.

All _TreePruningException raised in the main Visitor.visit() method will be delayed until extensions visitor visit() and depart() methods are run as well.

Meaning:
  • If the main module visitor raises SkipNode, the extension visitor set to run AFTER will still visit this node, but not it's children.
  • If your extension visitor is set to run BEFORE the main visitor and it raises SkipNode, the main visitor will not visit this node.
  • If a L{SkipNode} or L{SkipDeparture} exception is raised inside the main visitor C{visit()} method, the C{depart_*} method on the extensions will still be called.

See: When

Method __init__ Initialize the visitor extension.
Method attach Attach the parent visitor to this extension.
Method unknown_departure Called before exiting unknown object types.
Method unknown_visit Called when entering unknown object types.
Instance Variable visitor The parent visitor

Inherited from _BaseVisitor:

Method depart Depart an object.
Method visit Visit an object.
def __init__(self): (source)

Initialize the visitor extension.

def attach(self, visitor: Visitor[T]): (source)

Attach the parent visitor to this extension.

Parameters:
visitor: The parent visitor.
def unknown_departure(self, ob: T): (source)

Called before exiting unknown object types.

Raise exception unless overridden.

def unknown_visit(self, ob: T): (source)

Called when entering unknown object types.

Raise an exception unless overridden.

The parent visitor