Description
I'm a bit confused as to why Traversable
was ever implemented in the first place.
Seems like Traversable
is supposed to represent file system paths, however I was sure that's why we have Path
s.
Whatever Traversable
's added value is, I still think the class should be coupled to Path
type-wise. Maybe by marking Traversable
as PathLike
.
At the moment, functions like importlib.resources.files
specify a return type of Iterator[Traversable]
but in reality return Iterator[Path]
. This results in confusing type hint warnings since IDEs have no way to know that Traversable
and Path
are related.
I'm not very experienced with the newer versions of importlib
so my assumptions might be a bit off, hoping one of could shed some light.
Thanks
Originally posted by @moomoohk in #88366 (comment)