Skip to content

Commit 5a23f49

Browse files
author
hauntsaninja
committed
PathLike: change to Protocol
1 parent 0ee7b26 commit 5a23f49

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

stdlib/2/__builtin__.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ if sys.version_info >= (3, 6):
12071207
# This class is to be exported as PathLike from os,
12081208
# but we define it here as _PathLike to avoid import cycle issues.
12091209
# See https://github.com/python/typeshed/pull/991#issuecomment-288160993
1210-
class _PathLike(Generic[AnyStr]):
1210+
class _PathLike(Protocol[AnyStr]):
12111211
def __fspath__(self) -> AnyStr: ...
12121212
def compile(
12131213
source: Union[str, bytes, mod, AST],

stdlib/2and3/builtins.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ if sys.version_info >= (3, 6):
12071207
# This class is to be exported as PathLike from os,
12081208
# but we define it here as _PathLike to avoid import cycle issues.
12091209
# See https://github.com/python/typeshed/pull/991#issuecomment-288160993
1210-
class _PathLike(Generic[AnyStr]):
1210+
class _PathLike(Protocol[AnyStr]):
12111211
def __fspath__(self) -> AnyStr: ...
12121212
def compile(
12131213
source: Union[str, bytes, mod, AST],

stdlib/3/os/__init__.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ if sys.version_info >= (3, 6):
265265
_FdOrAnyPath = Union[int, AnyPath]
266266

267267
if sys.version_info >= (3, 6):
268-
class DirEntry(PathLike[AnyStr]):
268+
class DirEntry:
269269
# This is what the scandir interator yields
270270
# The constructor is hidden
271271

0 commit comments

Comments
 (0)