class ApiObject(_HasInitAttribsMethod): (source)
Known subclasses: pydocspec._docspec.HasMembers, pydocspec._docspec.Inheritable, pydocspec._model.ApiObject
The base class for representing "API Objects". Any API object is any addressable entity in code, be that a variable/constant, function, class or module.
| Method | __init__ |
Undocumented |
| Method | sync |
Synchronize the hierarchy of this API object and all of it's children. This should be called when the #HasMembers.members are updated to ensure that all child objects reference the right #parent. Loaders are expected to return #ApiObject#s in a fully synchronized state such that the user does not have to call this method unless they are doing modifications to the tree. |
| Instance Variable | docstring |
The documentation string of the API object. |
| Instance Variable | location |
The location of the API object, i.e. where it is sourced from/defined in the code. |
| Instance Variable | name |
The name of the entity. This is usually relative to the respective parent of the entity, as opposed to it's fully qualified name/absolute name. However, that is more of a recommendation than rule. For example the #docspec_python loader by default returns #Module objects with their full module name (and does not create a module hierarchy). |
| Instance Variable | parent |
The parent of the API object. |
| Property | path |
Returns a list of all of this API object's parents, from top to bottom. The list includes self as the last item. |
Inherited from _HasInitAttribsMethod:
| Method | _init |
A method to define extra attributes that will be set after initialization. |
pydocspec._docspec.Function, pydocspec._docspec.HasMembers, pydocspec._docspec.Indirection, pydocspec._docspec.Variable, pydocspec._model.Class, pydocspec._model.Function, pydocspec._model.Indirection, pydocspec._model.Module, pydocspec._model.Variable, pydocspec.Class, pydocspec.Function, pydocspec.Indirection, pydocspec.Module, pydocspec.VariableUndocumented
| Parameters | |
location:Location | Undocumented |
name:str | Undocumented |
docstring:t.Optional[ | Undocumented |
pydocspec._docspec.HasMembersSynchronize the hierarchy of this API object and all of it's children. This should be called when the #HasMembers.members are updated to ensure that all child objects reference the right #parent. Loaders are expected to return #ApiObject#s in a fully synchronized state such that the user does not have to call this method unless they are doing modifications to the tree.
| Parameters | |
parent:t.Optional[ | Undocumented |
pydocspec.ApiObjectThe location of the API object, i.e. where it is sourced from/defined in the code.
The name of the entity. This is usually relative to the respective parent of the entity, as opposed to it's fully qualified name/absolute name. However, that is more of a recommendation than rule. For example the #docspec_python loader by default returns #Module objects with their full module name (and does not create a module hierarchy).
pydocspec._docspec.HasMembers, pydocspec._model.ApiObject, pydocspec._model.Function, pydocspec.Indirection, pydocspec.VariableThe parent of the API object.