Helpers for inspecting Python modules.
Unknown Field: copyright | |
Copyright 2007-2022 by the Sphinx team, see AUTHORS. | |
Unknown Field: license | |
BSD, see LICENSE for details. |
Variable | logger |
Undocumented |
Variable | memory_address_re |
Undocumented |
Class | DefaultValue |
A simple wrapper for default value of the parameters of overload functions. |
Class | TypeAliasForwardRef |
Pseudo typing class for autodoc_type_aliases. |
Class | TypeAliasModule |
Pseudo module class for autodoc_type_aliases. |
Class | TypeAliasNamespace |
Pseudo namespace class for autodoc_type_aliases. |
Function | _should_unwrap |
Check the function should be unwrapped on getting signature. |
Function | evaluate_signature |
Evaluate unresolved type annotations in a signature object. |
Function | getall |
Get __all__ attribute of the module as dict. |
Function | getannotations |
Get __annotations__ from given obj safely. |
Function | getargspec |
Like inspect.getfullargspec but supports bound methods, and wrapped methods. |
Function | getdoc |
Get the docstring for the object. |
Function | getglobals |
Get __globals__ from given obj safely. |
Function | getmro |
Get __mro__ from given obj safely. |
Function | getorigbases |
Get __orig_bases__ from obj safely. |
Function | getslots |
Get __slots__ attribute of the class as dict. |
Function | is_builtin_class_method |
If attr_name is implemented at builtin class, return True. |
Function | is_cython_function_or_method |
Check if the object is a function or method in cython. |
Function | is_singledispatch_function |
Check if the object is singledispatch function. |
Function | is_singledispatch_method |
Check if the object is singledispatch method. |
Function | isabstractmethod |
Check if the object is an abstractmethod. |
Function | isasyncgenfunction |
Check if the object is async-gen function. |
Function | isattributedescriptor |
Check if the object is an attribute like descriptor. |
Function | isbuiltin |
Check if the object is builtin. |
Function | isclassmethod |
Check if the object is classmethod. |
Function | iscoroutinefunction |
Check if the object is coroutine-function. |
Function | isdescriptor |
Check if the object is some kind of descriptor. |
Function | isenumattribute |
Check if the object is attribute of enum. |
Function | isenumclass |
Check if the object is subclass of enum. |
Function | isfunction |
Check if the object is function. |
Function | isgenericalias |
Check if the object is GenericAlias. |
Function | isNewType |
Check the if object is a kind of NewType. |
Function | ispartial |
Check if the object is partial. |
Function | isproperty |
Check if the object is property. |
Function | isroutine |
Check is any kind of function or method. |
Function | isstaticmethod |
Check if the object is staticmethod. |
Function | object_description |
A repr() implementation that returns text safe to use in reST context. |
Function | safe_getattr |
A getattr() that turns all exceptions into AttributeErrors. |
Function | signature |
Return a Signature object for the given subject. |
Function | signature_from_ast |
Create a Signature object from AST node. |
Function | signature_from_str |
Create a Signature object from string. |
Function | stringify_signature |
Stringify a Signature object. |
Function | unpartial |
Get an original object from partial object. |
Function | unwrap |
Get an original object from wrapped object (wrapped functions). |
Function | unwrap_all |
Get an original object from wrapped object (unwrapping partials, wrapped functions, and other decorators). |
Parameters | |
subject:Callable | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
sig:inspect.Signature | Undocumented |
globalns:Dict | Undocumented |
localns:Dict | Undocumented |
Returns | |
inspect.Signature | Undocumented |
Get __all__ attribute of the module as dict.
Return None if given obj does not have __all__. Raises ValueError if given obj have invalid __all__.
Parameters | |
obj:Any | Undocumented |
Returns | |
Optional[ | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
Mapping[ | Undocumented |
Parameters | |
func:Callable | Undocumented |
Returns | |
Any | Undocumented |
Get the docstring for the object.
This tries to obtain the docstring for some kind of objects additionally:
Parameters | |
obj:Any | Undocumented |
attrgetter:Callable | Undocumented |
allow_inherited:bool | Undocumented |
cls:Any | Undocumented |
name:str | Undocumented |
Returns | |
str | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
Mapping[ | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
Tuple[ | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
Optional[ | Undocumented |
Get __slots__ attribute of the class as dict.
Return None if gienv obj does not have __slots__. Raises TypeError if given obj is not a class. Raises ValueError if given obj have invalid __slots__.
Parameters | |
obj:Any | Undocumented |
Returns | |
Optional[ | Undocumented |
If attr_name is implemented at builtin class, return True.
>>> is_builtin_class_method(int, '__init__') True
Why this function needed? CPython implements int.__init__ by Descriptor but PyPy implements it by pure Python code.
Parameters | |
obj:Any | Undocumented |
attr_name:str | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
cls:Any | Undocumented |
name:str | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
x:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
x:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
x:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
obj:Any | Undocumented |
cls:Any | Undocumented |
name:str | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
object:Any | Undocumented |
Returns | |
str | Undocumented |
Parameters | |
obj:Any | Undocumented |
name:str | Undocumented |
*defargs:Any | Undocumented |
Returns | |
Any | Undocumented |
Parameters | |
subject:Callable | Undocumented |
bound_method:bool | Specify subject is a bound method or not |
follow_wrapped:bool | Same as inspect.signature(). |
type_aliases:Dict | Undocumented |
Returns | |
inspect.Signature | Undocumented |
Parameters | |
node:ast.FunctionDef | Undocumented |
code:str | Undocumented |
Returns | |
inspect.Signature | Undocumented |
Parameters | |
signature:str | Undocumented |
Returns | |
inspect.Signature | Undocumented |
Parameters | |
sig:inspect.Signature | Undocumented |
show_annotation:bool | If enabled, show annotations on the signature |
show_return_annotation:bool | If enabled, show annotation of the return value |
unqualified_typehints:bool | If enabled, show annotations as unqualified (ex. io.StringIO -> StringIO) |
Returns | |
str | Undocumented |
Get an original object from partial object.
This returns given object itself if not partial.
Parameters | |
obj:Any | Undocumented |
Returns | |
Any | Undocumented |