mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-25 20:36:44 +08:00
Use typing_extensions.Self in the stdlib (#9694)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import io
|
||||
import sys
|
||||
from _typeshed import Self, StrOrBytesPath, StrPath, _BufferWithLen
|
||||
from _typeshed import StrOrBytesPath, StrPath, _BufferWithLen
|
||||
from collections.abc import Callable, Iterable, Iterator
|
||||
from os import PathLike
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, Protocol, overload
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
from typing_extensions import Literal, Self, TypeAlias
|
||||
|
||||
__all__ = [
|
||||
"BadZipFile",
|
||||
@@ -150,7 +150,7 @@ class ZipFile:
|
||||
compresslevel: int | None = None,
|
||||
) -> None: ...
|
||||
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(
|
||||
self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
|
||||
) -> None: ...
|
||||
@@ -214,12 +214,10 @@ class ZipInfo:
|
||||
def __init__(self, filename: str = "NoName", date_time: _DateTuple = ...) -> None: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@classmethod
|
||||
def from_file(
|
||||
cls: type[Self], filename: StrPath, arcname: StrPath | None = None, *, strict_timestamps: bool = True
|
||||
) -> Self: ...
|
||||
def from_file(cls, filename: StrPath, arcname: StrPath | None = None, *, strict_timestamps: bool = True) -> Self: ...
|
||||
else:
|
||||
@classmethod
|
||||
def from_file(cls: type[Self], filename: StrPath, arcname: StrPath | None = None) -> Self: ...
|
||||
def from_file(cls, filename: StrPath, arcname: StrPath | None = None) -> Self: ...
|
||||
|
||||
def is_dir(self) -> bool: ...
|
||||
def FileHeader(self, zip64: bool | None = None) -> bytes: ...
|
||||
|
||||
Reference in New Issue
Block a user