module documentation
Support for attrs
.
Class |
|
No class docstring; 1/1 instance variable, 0/1 method documented |
Class |
|
No class docstring; 1/4 method documented |
Function | annotation |
Get the type of an attr.ib definition. |
Function | attrib |
Get the arguments passed to an attr.ib definition. |
Function | is |
Does this expression return an attr.ib? |
Function | setup |
Undocumented |
Function | uses |
Does the given attr.s() decoration contain auto_attribs=True? |
Variable | attrib |
Signature of the attr.ib function for defining class attributes. |
Variable | attrs |
Signature of the attr.s class decorator. |
def annotation_from_attrib(self:
astbuilder.ModuleVistor
, expr: ast.expr
, ctx: model.Documentable
) -> ast.expr | None
:
(source)
¶
Get the type of an attr.ib definition.
Parameters | |
self:astbuilder.ModuleVistor | Undocumented |
expr:ast.expr | The ast.Call expression's AST. |
ctx:model.Documentable | The context in which this expression is evaluated. |
Returns | |
ast.expr | None | A type annotation, or None if the expression is not an attr.ib definition or contains no type information. |
def attrib_args(expr:
ast.expr
, ctx: model.Documentable
) -> inspect.BoundArguments | None
:
(source)
¶
Get the arguments passed to an attr.ib definition.
Returns | |
inspect.BoundArguments | None | The arguments, or None if expr does not look like an attr.ib definition or the arguments passed to it are invalid. |
Does the given attr.s()
decoration contain auto_attribs=True?
Parameters | |
call:ast.AST | AST of the call to attr.s() . This function will assume that attr.s() is called without verifying that. |
module:model.Module | Module that contains the call, used for error reporting. |
Returns | |
bool | True 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. |