mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Replace various Incompletes in stdlib (#11673)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import abc
|
||||
import sys
|
||||
from _typeshed import Incomplete, OpenBinaryMode, OpenTextMode, Unused
|
||||
from collections.abc import Iterator
|
||||
from io import TextIOWrapper
|
||||
from typing import IO, Any, BinaryIO, Literal, NoReturn, overload
|
||||
@@ -28,11 +27,19 @@ if sys.version_info >= (3, 11):
|
||||
def is_file(self) -> Literal[True]: ...
|
||||
def is_dir(self) -> Literal[False]: ...
|
||||
@overload
|
||||
def open(self, mode: OpenTextMode = "r", *args, **kwargs) -> TextIOWrapper: ...
|
||||
def open(
|
||||
self,
|
||||
mode: Literal["r"] = "r",
|
||||
encoding: str | None = None,
|
||||
errors: str | None = None,
|
||||
newline: str | None = None,
|
||||
line_buffering: bool = False,
|
||||
write_through: bool = False,
|
||||
) -> TextIOWrapper: ...
|
||||
@overload
|
||||
def open(self, mode: OpenBinaryMode, *args: Unused, **kwargs: Unused) -> BinaryIO: ...
|
||||
def open(self, mode: Literal["rb"]) -> BinaryIO: ...
|
||||
@overload
|
||||
def open(self, mode: str, *args: Incomplete, **kwargs) -> IO[Any]: ...
|
||||
def open(self, mode: str) -> IO[Any]: ...
|
||||
def joinpath(self, name: Never) -> NoReturn: ... # type: ignore[override]
|
||||
|
||||
class ResourceContainer(Traversable, metaclass=abc.ABCMeta):
|
||||
|
||||
Reference in New Issue
Block a user