pydoctor.model.Documentable
instances.Class | ASTBuilder |
Undocumented |
Class | ModuleVistor |
No class docstring; 0/5 instance variable, 7/29 methods documented |
Function | attrib_args |
Get the arguments passed to an attr.ib definition. @return: The arguments, or None if expr does not look like an attr.ib definition or the arguments passed to it are invalid. |
Function | extract_final_subscript |
Extract the "str" part from annotations like "Final[str]". |
Function | findModuleLevelAssign |
Find module level Assign. Yields tuples containing the assigment name and the Assign node. |
Function | is_attrib |
Does this expression return an attr.ib? |
Function | is_attribute_overridden |
Detect if the optional new_value expression override the one already stored in the Attribute.value attribute. |
Function | is_constant |
Detect if the given assignment is a constant. |
Function | is_using_typing_final |
Detect if obj's Attribute.annotation is using typing.Final . |
Function | node2fullname |
Undocumented |
Function | parseAll |
Find and attempt to parse into a list of names the __all__ variable of a module's AST and set Module.all accordingly. |
Function | parseDocformat |
Find __docformat__ variable of this module's AST and set Module.docformat accordingly. |
Function | parseFile |
Parse the contents of a Python source file. |
Constant | MODULE_VARIABLES_META_PARSERS |
Undocumented |
Variable | DocumentableT |
Undocumented |
Class | _AnnotationStringParser |
Implementation of ModuleVistor._unstring_annotation() . |
Class | _ValueFormatter |
Class to encapsulate a python value and translate it to HTML when calling repr() on the _ValueFormatter . Used for presenting default values of parameters. |
Function | _annotation_for_elements |
Undocumented |
Function | _annotation_for_value |
Undocumented |
Function | _extract_annotation_subscript |
Extract the "str, bytes" part from annotations like "Union[str, bytes]". |
Function | _handleAliasing |
If the given expression is a name assigned to a target that is not yet in use, create an alias. @return: True iff an alias was created. |
Function | _infer_type |
Infer an expression's type. @param expr: The expression's AST. @return: A type annotation, or None if the expression has no obvious type. |
Function | _maybeAttribute |
Check whether a name is a potential attribute of the given class. This is used to prevent an assignment that wraps a method from creating an attribute that would overwrite or shadow that method. |
Function | _uses_auto_attribs |
No summary |
Variable | _attrib_signature |
Signature of the attr.ib function for defining class attributes. |
Variable | _attrs_decorator_signature |
Signature of the attr.s class decorator. |
Variable | _parse |
Undocumented |
Parameters | |
expr:ast.expr | Undocumented |
ctx:model.Documentable | Undocumented |
Returns | |
Optional[ | The arguments, or None if expr does not look like an attr.ib definition or the arguments passed to it are invalid. |
Parameters | |
annotation:ast.Subscript | Undocumented |
Returns | |
ast.expr | Undocumented |
Raises | |
ValueError | If the "Final" annotation is not valid. |
Parameters | |
mod_ast:ast.Module | Undocumented |
Returns | |
Iterator[ | Undocumented |
Parameters | |
expr:Optional[ | Undocumented |
ctx:model.Documentable | Undocumented |
Returns | |
bool | Undocumented |
Attribute.value
attribute.Parameters | |
obj:model.Attribute | Undocumented |
new_value:Optional[ | Undocumented |
Returns | |
bool | Undocumented |
Detect if the given assignment is a constant.
To detect whether a assignment is a constant, this checks two things:
Parameters | |
obj:model.Attribute | Undocumented |
Returns | |
bool | Undocumented |
Note | |
Must be called after setting obj.annotation to detect variables using Final. |
Attribute.annotation
is using typing.Final
.Parameters | |
obj:model.Attribute | Undocumented |
Returns | |
bool | Undocumented |
Undocumented
Parameters | |
expr:Optional[ | Undocumented |
ctx:model.Documentable | Undocumented |
Returns | |
Optional[ | Undocumented |
Module.all
accordingly.Parameters | |
node:ast.Assign | Undocumented |
mod:model.Module | Undocumented |
Find __docformat__ variable of this module's AST and set Module.docformat
accordingly.
This is all valid:
__docformat__ = "reStructuredText en" __docformat__ = "epytext" __docformat__ = "restructuredtext"
Parameters | |
node:ast.Assign | Undocumented |
mod:model.Module | Undocumented |
Parameters | |
path:Path | Undocumented |
Returns | |
ast.Module | Undocumented |
Mapping[ str, Callable[ [ ast.Assign, model.Module], None]]
=
Undocumented
Value |
|
Undocumented
Parameters | |
sequence:Iterable[ | Undocumented |
Returns | |
Optional[ | Undocumented |
Undocumented
Parameters | |
value:object | Undocumented |
Returns | |
Optional[ | Undocumented |
Parameters | |
annotation:ast.Subscript | Undocumented |
Returns | |
ast.AST | Undocumented |
Parameters | |
ctx:model.CanContainImportsDocumentable | Undocumented |
target:str | Undocumented |
expr:Optional[ | Undocumented |
Returns | |
bool | True iff an alias was created. |
Parameters | |
expr:ast.expr | The expression's AST. |
Returns | |
Optional[ | A type annotation, or None if the expression has no obvious type. |
Parameters | |
name:str | Undocumented |
Returns | |
bool | True if the name does not exist or is an existing (possibly inherited) attribute, False otherwise |
attr.s()
decoration contain auto_attribs=True?Parameters | |
call:ast.Call | 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. |