module documentation

Update annotations info of living objects using type_comments.

Unknown Field: copyright
Copyright 2007-2022 by the Sphinx team, see AUTHORS.
Unknown Field: license
BSD, see LICENSE for details.
Variable logger Undocumented
Function get​_type​_comment Get type_comment'ed FunctionDef object from living object.
Function not​_suppressed Check given argtypes is suppressed type_comment or not.
Function setup Undocumented
Function signature​_from​_ast Return a Signature object for the given node.
Function update​_annotations​_using​_type​_comments Update annotations info of obj using type_comments.
logger =

Undocumented

def get_type_comment(obj, bound_method=False):

Get type_comment'ed FunctionDef object from living object.

This tries to parse original code for living object and returns Signature for given obj. It requires py38+ or typed_ast module.

Parameters
obj:AnyUndocumented
bound​_method:boolUndocumented
Returns
SignatureUndocumented
def not_suppressed(argtypes=[]):
Check given argtypes is suppressed type_comment or not.
Parameters
argtypes:List[ast.AST]Undocumented
Returns
boolUndocumented
def setup(app):

Undocumented

Parameters
app:SphinxUndocumented
Returns
Dict[str, Any]Undocumented
def signature_from_ast(node, bound_method, type_comment):
Return a Signature object for the given node.
Parameters
node:ast.FunctionDefUndocumented
bound​_method:boolSpecify node is a bound method or not
type​_comment:ast.FunctionDefUndocumented
Returns
SignatureUndocumented
def update_annotations_using_type_comments(app, obj, bound_method):
Update annotations info of obj using type_comments.
Parameters
app:SphinxUndocumented
obj:AnyUndocumented
bound​_method:boolUndocumented