MCPcopy
hub / github.com/python/mypy / get_type

Method get_type

mypy/stubtest.py:926–931  ·  view source on GitHub ↗
(arg: Any)

Source from the content-addressed store, hash-verified

924 raise AssertionError
925
926 def get_type(arg: Any) -> str | None:
927 if isinstance(arg, inspect.Parameter):
928 return None
929 if isinstance(arg, nodes.Argument):
930 return str(arg.variable.type or arg.type_annotation)
931 raise AssertionError
932
933 def has_default(arg: Any) -> bool:
934 if isinstance(arg, inspect.Parameter):

Callers

nothing calls this directly

Calls 4

isinstanceFunction · 0.85
strClass · 0.85
strict_optional_setMethod · 0.80
make_simplified_unionMethod · 0.80

Tested by

no test coverage detected