%PDF- %PDF-
| Direktori : /proc/self/root/usr/lib/python3/dist-packages/mypy/ |
| Current File : //proc/self/root/usr/lib/python3/dist-packages/mypy/state.py |
from contextlib import contextmanager
from typing import Optional, Tuple, Iterator
# These are global mutable state. Don't add anything here unless there's a very
# good reason.
# Value varies by file being processed
strict_optional = False
find_occurrences: Optional[Tuple[str, str]] = None
@contextmanager
def strict_optional_set(value: bool) -> Iterator[None]:
global strict_optional
saved = strict_optional
strict_optional = value
try:
yield
finally:
strict_optional = saved