Use _typeshed.Self in Python 2, too (#6932)

This commit is contained in:
Alex Waygood
2022-01-16 22:44:51 +00:00
committed by GitHub
parent 0949e9e90d
commit 6a88d5e7ae
29 changed files with 156 additions and 160 deletions

View File

@@ -1,3 +1,4 @@
from _typeshed import Self
from types import CodeType
from typing import Any, Callable, Dict, Text, Tuple, TypeVar
@@ -6,7 +7,6 @@ def runctx(
statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: str | None = ..., sort: str | int = ...
) -> None: ...
_SelfT = TypeVar("_SelfT", bound=Profile)
_T = TypeVar("_T")
_Label = Tuple[str, int, str]
@@ -21,8 +21,8 @@ class Profile:
def dump_stats(self, file: Text) -> None: ...
def create_stats(self) -> None: ...
def snapshot_stats(self) -> None: ...
def run(self: _SelfT, cmd: str) -> _SelfT: ...
def runctx(self: _SelfT, cmd: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> _SelfT: ...
def run(self: Self, cmd: str) -> Self: ...
def runctx(self: Self, cmd: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> Self: ...
def runcall(self, __func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ...
def label(code: str | CodeType) -> _Label: ... # undocumented