MCPcopy Index your code
hub / github.com/python/mypy / emit_arg_processing

Method emit_arg_processing

mypyc/codegen/emitwrapper.py:892–912  ·  view source on GitHub ↗

Emit validation and unboxing of arguments.

(
        self, error: ErrorHandler | None = None, raise_exception: bool = True
    )

Source from the content-addressed store, hash-verified

890 )
891
892 def emit_arg_processing(
893 self, error: ErrorHandler | None = None, raise_exception: bool = True
894 ) -> None:
895 """Emit validation and unboxing of arguments."""
896 error = error or self.error()
897 bitmap_arg_index = 0
898 for arg_name, arg in zip(self.arg_names, self.args):
899 # Suppress the argument check for *args/**kwargs, since we know it must be right.
900 typ = arg.type if arg.kind not in (ARG_STAR, ARG_STAR2) else object_rprimitive
901 optional = arg in self.optional_args
902 generate_arg_check(
903 arg_name,
904 typ,
905 self.emitter,
906 error,
907 raise_exception=raise_exception,
908 optional=optional,
909 bitmap_arg_index=bitmap_arg_index,
910 )
911 if optional and typ.error_overlap:
912 bitmap_arg_index += 1
913
914 def emit_call(self, not_implemented_handler: str = "") -> None:
915 """Emit call to the wrapper function.

Calls 3

errorMethod · 0.95
zipFunction · 0.85
generate_arg_checkFunction · 0.85

Tested by

no test coverage detected