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

Method has_default

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

Source from the content-addressed store, hash-verified

931 raise AssertionError
932
933 def has_default(arg: Any) -> bool:
934 if isinstance(arg, inspect.Parameter):
935 return arg.default is not inspect.Parameter.empty
936 if isinstance(arg, nodes.Argument):
937 return arg.kind.is_optional()
938 raise AssertionError
939
940 def get_desc(arg: Any) -> str:
941 arg_type = get_type(arg)

Callers 13

visit_type_varMethod · 0.45
visit_param_specMethod · 0.45
visit_type_var_tupleMethod · 0.45
tvar_defs_from_tvarsMethod · 0.45
fix_instanceFunction · 0.45
instantiate_type_aliasFunction · 0.45
set_any_tvarsFunction · 0.45
validate_instanceFunction · 0.45
visit_type_varMethod · 0.45
get_target_typeFunction · 0.45

Calls 2

isinstanceFunction · 0.85
is_optionalMethod · 0.45

Tested by

no test coverage detected