polymerist.genutils.decorators.signatures ========================================= .. py:module:: polymerist.genutils.decorators.signatures .. autoapi-nested-parse:: Tools for simplifying transfer and modification of wrapped function type signatures Attributes ---------- .. autoapisummary:: polymerist.genutils.decorators.signatures.POSITIONAL_PARAMETER_TYPES polymerist.genutils.decorators.signatures.KEYWORD_PARAMETER_TYPES Functions --------- .. autoapisummary:: polymerist.genutils.decorators.signatures.get_index_after_positionals polymerist.genutils.decorators.signatures.insert_parameter_at_index polymerist.genutils.decorators.signatures.modify_param_annotation_by_index polymerist.genutils.decorators.signatures.modify_param_annotation_by_name Module Contents --------------- .. py:data:: POSITIONAL_PARAMETER_TYPES .. py:data:: KEYWORD_PARAMETER_TYPES .. py:function:: get_index_after_positionals(sig: inspect.Signature) -> int Get the first Parameter index which follows all positional Parameters .. py:function:: insert_parameter_at_index(sig: inspect.Signature, new_param: inspect.Parameter, index: int) -> inspect.Signature Insert a new Parameter into a Signature at a given position .. py:function:: modify_param_annotation_by_index(sig: inspect.Signature, index: int, new_type: type) -> inspect.Signature Returns a copy of a Signature with the type annotation of the Parameter at a given index swapped out .. py:function:: modify_param_annotation_by_name(sig: inspect.Signature, param_name: str, new_type: type) -> inspect.Signature Returns a copy of a Signature with the type annotation of the Parameter with a given name swapped out