module documentation

Support for attrs.

Class AttrsClass No class docstring; 1/1 instance variable, 0/1 method documented
Class ModuleVisitor No class docstring; 1/4 method documented
Function annotation_from_attrib Get the type of an attr.ib definition.
Function attrib_args Get the arguments passed to an attr.ib definition.
Function is_attrib Does this expression return an attr.ib?
Function setup_pydoctor_extension Undocumented
Function uses_auto_attribs Does the given attr.s() decoration contain auto_attribs=True?
Variable attrib_signature Signature of the attr.ib function for defining class attributes.
Variable attrs_decorator_signature Signature of the attr.s class decorator.
def annotation_from_attrib(self, expr, ctx): (source)

Get the type of an attr.ib definition.

Parameters
self:astbuilder.ModuleVistorUndocumented
expr:ast.exprThe ast.Call expression's AST.
ctx:model.DocumentableThe context in which this expression is evaluated.
Returns
Optional[ast.expr]A type annotation, or None if the expression is not an attr.ib definition or contains no type information.
def attrib_args(expr, ctx): (source)

Get the arguments passed to an attr.ib definition.

Parameters
expr:ast.exprUndocumented
ctx:model.DocumentableUndocumented
Returns
Optional[inspect.BoundArguments]The arguments, or None if expr does not look like an attr.ib definition or the arguments passed to it are invalid.
def is_attrib(expr, ctx): (source)

Does this expression return an attr.ib?

Parameters
expr:Optional[ast.expr]Undocumented
ctx:model.DocumentableUndocumented
Returns
boolUndocumented
def setup_pydoctor_extension(r): (source)

Undocumented

Parameters
r:extensions.ExtRegistrarUndocumented
def uses_auto_attribs(call, module): (source)

Does the given attr.s() decoration contain auto_attribs=True?

Parameters
call:ast.ASTAST of the call to attr.s(). This function will assume that attr.s() is called without verifying that.
module:model.ModuleModule that contains the call, used for error reporting.
Returns
boolTrue if True is passed for auto_attribs, False in all other cases: if auto_attribs is not passed, if an explicit False is passed or if an error was reported.
attrib_signature = (source)

Signature of the attr.ib function for defining class attributes.

attrs_decorator_signature = (source)

Signature of the attr.s class decorator.