mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-23 20:31:32 +08:00
Use _typeshed.Self where __enter__ returns self (#5698)
This commit is contained in:
committed by
GitHub
parent
1fb100dca4
commit
58559e56b3
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, List, NamedTuple, Optional, Tuple, Type, Union, overload
|
||||
from typing_extensions import Literal
|
||||
@@ -18,7 +19,7 @@ _Marker = Tuple[int, int, bytes]
|
||||
|
||||
class Aifc_read:
|
||||
def __init__(self, f: _File) -> None: ...
|
||||
def __enter__(self) -> Aifc_read: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
|
||||
) -> None: ...
|
||||
@@ -42,7 +43,7 @@ class Aifc_read:
|
||||
class Aifc_write:
|
||||
def __init__(self, f: _File) -> None: ...
|
||||
def __del__(self) -> None: ...
|
||||
def __enter__(self) -> Aifc_write: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
|
||||
) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user