mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
The four protocol-like ABCs outside of collections.abc inherit from ABC directly (#13005)
This commit is contained in:
@@ -19,7 +19,7 @@ from _typeshed import (
|
||||
WriteableBuffer,
|
||||
structseq,
|
||||
)
|
||||
from abc import abstractmethod
|
||||
from abc import ABC, abstractmethod
|
||||
from builtins import OSError
|
||||
from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping, Sequence
|
||||
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
|
||||
@@ -412,8 +412,11 @@ In the future, this property will contain the last metadata change time."""
|
||||
# Attributes documented as sometimes appearing, but deliberately omitted from the stub: `st_creator`, `st_rsize`, `st_type`.
|
||||
# See https://github.com/python/typeshed/pull/6560#issuecomment-991253327
|
||||
|
||||
# mypy and pyright object to this being both ABC and Protocol.
|
||||
# At runtime it inherits from ABC and is not a Protocol, but it will be
|
||||
# on the allowlist for use as a Protocol starting in 3.14.
|
||||
@runtime_checkable
|
||||
class PathLike(Protocol[AnyStr_co]):
|
||||
class PathLike(ABC, Protocol[AnyStr_co]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
|
||||
@abstractmethod
|
||||
def __fspath__(self) -> AnyStr_co: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user