Change Traversable to be inline with pathlib.Path (#5818)

`pathlib.Path` objects are now valid `importlib.abc.Traversable`s.
This commit is contained in:
Estelle Poulin
2021-09-21 14:36:10 -04:00
committed by GitHub
parent d1a556cec9
commit 15cec1da8e
2 changed files with 79 additions and 12 deletions

View File

@@ -88,6 +88,7 @@ class Path(PurePath):
def mkdir(self, mode: int = ..., parents: bool = ..., exist_ok: bool = ...) -> None: ...
# Adapted from builtins.open
# Text mode: always returns a TextIOWrapper
# The Traversable .open in stdlib/importlib/abc.pyi should be kept in sync with this.
@overload
def open(
self,