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

Method strict_optional_set

mypy/state.py:19–25  ·  view source on GitHub ↗
(self, value: bool)

Source from the content-addressed store, hash-verified

17
18 @contextmanager
19 def strict_optional_set(self, value: bool) -> Iterator[None]:
20 saved = self.strict_optional
21 self.strict_optional = value
22 try:
23 yield
24 finally:
25 self.strict_optional = saved
26
27
28state: Final = StrictOptionalState(strict_optional=True)

Callers 15

check_first_passMethod · 0.80
check_second_passMethod · 0.80
fix_instanceFunction · 0.80
set_any_tvarsFunction · 0.80
get_typeMethod · 0.80
is_subtype_helperFunction · 0.80
check_type_argumentsFunction · 0.80
get_suggestionMethod · 0.80
refine_unionFunction · 0.80

Calls

no outgoing calls

Tested by 10

get_typeMethod · 0.64
is_subtype_helperFunction · 0.64
test_false_only_tupleMethod · 0.64
test_noneMethod · 0.64
test_any_typeMethod · 0.64
test_simple_genericsMethod · 0.64
test_noneMethod · 0.64