mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-23 19:41:51 +08:00
Use _typeshed.Self in Python 2, too (#6932)
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
import io
|
||||
from _typeshed import ReadableBuffer, WriteableBuffer
|
||||
from typing import IO, Any, Iterable, List, Text, TypeVar, Union
|
||||
from _typeshed import ReadableBuffer, Self, WriteableBuffer
|
||||
from typing import IO, Any, Iterable, List, Text, Union
|
||||
from typing_extensions import SupportsIndex
|
||||
|
||||
_PathOrFile = Union[Text, IO[bytes]]
|
||||
_T = TypeVar("_T")
|
||||
|
||||
def compress(data: bytes, compresslevel: int = ...) -> bytes: ...
|
||||
def decompress(data: bytes) -> bytes: ...
|
||||
|
||||
class BZ2File(io.BufferedIOBase, IO[bytes]):
|
||||
def __enter__(self: _T) -> _T: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __init__(self, filename: _PathOrFile, mode: str = ..., buffering: Any | None = ..., compresslevel: int = ...) -> None: ...
|
||||
def read(self, size: int | None = ...) -> bytes: ...
|
||||
def read1(self, size: int = ...) -> bytes: ...
|
||||
|
||||
Reference in New Issue
Block a user