Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stdlib/importlib/readers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ if sys.version_info >= (3, 10):
def is_file(self) -> Literal[False]: ...

if sys.version_info >= (3, 12):
def joinpath(self, *descendants: str) -> abc.Traversable: ...
def joinpath(self, *descendants: StrPath) -> abc.Traversable: ...
elif sys.version_info >= (3, 11):
def joinpath(self, child: str) -> abc.Traversable: ... # type: ignore[override]
def joinpath(self, child: StrPath) -> abc.Traversable: ... # type: ignore[override]
else:
def joinpath(self, child: str) -> abc.Traversable: ...

Expand Down
5 changes: 3 additions & 2 deletions stdlib/importlib/resources/abc.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
from _typeshed import StrPath
from abc import ABCMeta, abstractmethod
from collections.abc import Iterator
from io import BufferedReader
Expand All @@ -24,7 +25,7 @@ if sys.version_info >= (3, 11):
@abstractmethod
def iterdir(self) -> Iterator[Traversable]: ...
@abstractmethod
def joinpath(self, *descendants: str) -> Traversable: ...
def joinpath(self, *descendants: StrPath) -> Traversable: ...

# The documentation and runtime protocol allows *args, **kwargs arguments,
# but this would mean that all implementers would have to support them,
Expand All @@ -38,7 +39,7 @@ if sys.version_info >= (3, 11):
@property
@abstractmethod
def name(self) -> str: ...
def __truediv__(self, child: str, /) -> Traversable: ...
def __truediv__(self, child: StrPath, /) -> Traversable: ...
@abstractmethod
def read_bytes(self) -> bytes: ...
@abstractmethod
Expand Down
3 changes: 2 additions & 1 deletion stdlib/importlib/resources/simple.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import abc
import sys
from _typeshed import StrPath
from collections.abc import Iterator
from io import TextIOWrapper
from typing import IO, Any, BinaryIO, Literal, NoReturn, overload
Expand Down Expand Up @@ -50,7 +51,7 @@ if sys.version_info >= (3, 11):
def iterdir(self) -> Iterator[ResourceHandle | ResourceContainer]: ...
def open(self, *args: Never, **kwargs: Never) -> NoReturn: ... # type: ignore[override]
if sys.version_info < (3, 12):
def joinpath(self, *descendants: str) -> Traversable: ...
def joinpath(self, *descendants: StrPath) -> Traversable: ...

class TraversableReader(TraversableResources, SimpleReader, metaclass=abc.ABCMeta):
def files(self) -> ResourceContainer: ...