mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Stdlib: add 'obvious' default values (#9688)
This commit is contained in:
@@ -133,7 +133,7 @@ if sys.version_info >= (3, 9):
|
||||
@overload
|
||||
@abstractmethod
|
||||
def open(
|
||||
self, mode: OpenBinaryMode, buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ...
|
||||
self, mode: OpenBinaryMode, buffering: Literal[0], encoding: None = None, errors: None = None, newline: None = None
|
||||
) -> FileIO: ...
|
||||
# Buffering is on: return BufferedRandom, BufferedReader, or BufferedWriter
|
||||
@overload
|
||||
@@ -142,9 +142,9 @@ if sys.version_info >= (3, 9):
|
||||
self,
|
||||
mode: OpenBinaryModeUpdating,
|
||||
buffering: Literal[-1, 1] = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
newline: None = ...,
|
||||
encoding: None = None,
|
||||
errors: None = None,
|
||||
newline: None = None,
|
||||
) -> BufferedRandom: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
@@ -152,9 +152,9 @@ if sys.version_info >= (3, 9):
|
||||
self,
|
||||
mode: OpenBinaryModeWriting,
|
||||
buffering: Literal[-1, 1] = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
newline: None = ...,
|
||||
encoding: None = None,
|
||||
errors: None = None,
|
||||
newline: None = None,
|
||||
) -> BufferedWriter: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
@@ -162,15 +162,15 @@ if sys.version_info >= (3, 9):
|
||||
self,
|
||||
mode: OpenBinaryModeReading,
|
||||
buffering: Literal[-1, 1] = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
newline: None = ...,
|
||||
encoding: None = None,
|
||||
errors: None = None,
|
||||
newline: None = None,
|
||||
) -> BufferedReader: ...
|
||||
# Buffering cannot be determined: fall back to BinaryIO
|
||||
@overload
|
||||
@abstractmethod
|
||||
def open(
|
||||
self, mode: OpenBinaryMode, buffering: int = ..., encoding: None = ..., errors: None = ..., newline: None = ...
|
||||
self, mode: OpenBinaryMode, buffering: int = ..., encoding: None = None, errors: None = None, newline: None = None
|
||||
) -> BinaryIO: ...
|
||||
# Fallback if mode is not specified
|
||||
@overload
|
||||
|
||||
@@ -132,7 +132,7 @@ class Distribution:
|
||||
@overload
|
||||
@classmethod
|
||||
def discover(
|
||||
cls, *, context: None = ..., name: str | None = ..., path: list[str] = ..., **kwargs: Any
|
||||
cls, *, context: None = None, name: str | None = ..., path: list[str] = ..., **kwargs: Any
|
||||
) -> Iterable[Distribution]: ...
|
||||
@staticmethod
|
||||
def at(path: StrPath) -> PathDistribution: ...
|
||||
@@ -185,7 +185,7 @@ def distribution(distribution_name: str) -> Distribution: ...
|
||||
def distributions(*, context: DistributionFinder.Context) -> Iterable[Distribution]: ...
|
||||
@overload
|
||||
def distributions(
|
||||
*, context: None = ..., name: str | None = ..., path: list[str] = ..., **kwargs: Any
|
||||
*, context: None = None, name: str | None = ..., path: list[str] = ..., **kwargs: Any
|
||||
) -> Iterable[Distribution]: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
|
||||
Reference in New Issue
Block a user