mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Use PEP 570 syntax in stdlib (#11250)
This commit is contained in:
@@ -72,7 +72,7 @@ if sys.version_info >= (3, 10):
|
||||
def invalidate_caches(self) -> None: ...
|
||||
# Not defined on the actual class, but expected to exist.
|
||||
def find_spec(
|
||||
self, __fullname: str, __path: Sequence[str] | None, __target: types.ModuleType | None = ...
|
||||
self, fullname: str, path: Sequence[str] | None, target: types.ModuleType | None = ..., /
|
||||
) -> ModuleSpec | None: ...
|
||||
|
||||
class PathEntryFinder(metaclass=ABCMeta):
|
||||
@@ -91,7 +91,7 @@ else:
|
||||
def invalidate_caches(self) -> None: ...
|
||||
# Not defined on the actual class, but expected to exist.
|
||||
def find_spec(
|
||||
self, __fullname: str, __path: Sequence[str] | None, __target: types.ModuleType | None = ...
|
||||
self, fullname: str, path: Sequence[str] | None, target: types.ModuleType | None = ..., /
|
||||
) -> ModuleSpec | None: ...
|
||||
|
||||
class PathEntryFinder(Finder):
|
||||
@@ -138,25 +138,25 @@ if sys.version_info >= (3, 9):
|
||||
def joinpath(self, *descendants: str) -> Traversable: ...
|
||||
else:
|
||||
@abstractmethod
|
||||
def joinpath(self, __child: str) -> Traversable: ...
|
||||
def joinpath(self, child: str, /) -> Traversable: ...
|
||||
|
||||
# The documentation and runtime protocol allows *args, **kwargs arguments,
|
||||
# but this would mean that all implementers would have to support them,
|
||||
# which is not the case.
|
||||
@overload
|
||||
@abstractmethod
|
||||
def open(self, __mode: Literal["r"] = "r", *, encoding: str | None = None, errors: str | None = None) -> IO[str]: ...
|
||||
def open(self, mode: Literal["r"] = "r", /, *, encoding: str | None = None, errors: str | None = None) -> IO[str]: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
def open(self, __mode: Literal["rb"]) -> IO[bytes]: ...
|
||||
def open(self, mode: Literal["rb"], /) -> IO[bytes]: ...
|
||||
@property
|
||||
@abstractmethod
|
||||
def name(self) -> str: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def __truediv__(self, __child: str) -> Traversable: ...
|
||||
def __truediv__(self, child: str, /) -> Traversable: ...
|
||||
else:
|
||||
@abstractmethod
|
||||
def __truediv__(self, __child: str) -> Traversable: ...
|
||||
def __truediv__(self, child: str, /) -> Traversable: ...
|
||||
|
||||
@abstractmethod
|
||||
def read_bytes(self) -> bytes: ...
|
||||
|
||||
Reference in New Issue
Block a user