Use _typeshed.Self with __enter__ (#5717)

Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
Anton Grübel
2021-07-01 12:32:32 +02:00
committed by GitHub
parent 04f0113d16
commit 96e0660fba
12 changed files with 44 additions and 39 deletions

View File

@@ -1,19 +1,18 @@
from _typeshed import Self
from types import ModuleType
from typing import Any, Dict, Optional, TypeVar
_T = TypeVar("_T")
from typing import Any, Dict, Optional
class _TempModule:
mod_name: str = ...
module: ModuleType = ...
def __init__(self, mod_name: str) -> None: ...
def __enter__(self: _T) -> _T: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, *args: Any) -> None: ...
class _ModifiedArgv0:
value: Any = ...
def __init__(self, value: Any) -> None: ...
def __enter__(self: _T) -> _T: ...
def __enter__(self) -> None: ...
def __exit__(self, *args: Any) -> None: ...
def run_module(