mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
Use _typeshed.Self with __enter__ (#5712)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from _typeshed import StrOrBytesPath
|
||||
from _typeshed import Self, StrOrBytesPath
|
||||
from types import CodeType
|
||||
from typing import Any, Callable, Dict, Optional, Tuple, TypeVar, Union
|
||||
|
||||
@@ -8,7 +8,6 @@ def runctx(
|
||||
statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ...
|
||||
) -> None: ...
|
||||
|
||||
_SelfT = TypeVar("_SelfT", bound=Profile)
|
||||
_T = TypeVar("_T")
|
||||
_Label = Tuple[str, int, str]
|
||||
|
||||
@@ -23,11 +22,11 @@ class Profile:
|
||||
def dump_stats(self, file: StrOrBytesPath) -> 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: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def __enter__(self: _SelfT) -> _SelfT: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(self, *exc_info: Any) -> None: ...
|
||||
|
||||
def label(code: Union[str, CodeType]) -> _Label: ... # undocumented
|
||||
|
||||
Reference in New Issue
Block a user