ClassInfo

class ClassInfo(name: str, lineno: int, bases: list[str] = <factory>, decorators: list[str] = <factory>, methods: list[FunctionInfo] = <factory>)[source]

Bases: object

Metadata for a single class definition from the AST.

Parameters:
  • name (str)

  • lineno (int)

  • bases (list of str) – Base class expressions as unparsed strings (e.g. ["Element"]).

  • decorators (list of str) – Plain decorator names.

  • methods (list of FunctionInfo) – Methods defined directly in the class body.

Examples

>>> info = ClassInfo(name="Widget", lineno=10, bases=["Element"])
>>> info.decorators
[]
name: str
lineno: int
bases: list[str]
decorators: list[str]
methods: list[FunctionInfo]
__init__(name: str, lineno: int, bases: list[str] = <factory>, decorators: list[str] = <factory>, methods: list[FunctionInfo] = <factory>) None

See also

Public API reference — overview of all public names.