class Traversable(Protocol): (source)
Known subclasses: setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.ChildPath
, setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.OrphanPath
, setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.SpecPath
, setuptools._vendor.importlib_resources.readers.MultiplexedPath
, setuptools._vendor.importlib_resources.simple.ResourceContainer
, setuptools._vendor.importlib_resources.simple.ResourceHandle
An object with a subset of pathlib.Path methods suitable for traversing directories and opening files. Any exceptions that occur when accessing the backing resource may propagate unaltered.
Method | __truediv__ |
Return Traversable child in self |
Method | is |
Return True if self is a directory |
Method | is |
Return True if self is a file |
Method | iterdir |
Yield Traversable objects in self |
Method | joinpath |
Return Traversable resolved with any descendants applied. |
Method | open |
mode may be 'r' or 'rb' to open as text or binary. Return a handle suitable for reading (same as pathlib.Path.open). |
Method | read |
Read contents of self as bytes |
Method | read |
Read contents of self as text |
Property | name |
The base name of this object without any parent references. |
setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.ChildPath
, setuptools._vendor.importlib_resources.readers.MultiplexedPath
, setuptools._vendor.importlib_resources.simple.ResourceContainer
, setuptools._vendor.importlib_resources.simple.ResourceHandle
Return True if self is a directory
setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.ChildPath
, setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.OrphanPath
, setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.SpecPath
, setuptools._vendor.importlib_resources.readers.MultiplexedPath
, setuptools._vendor.importlib_resources.simple.ResourceContainer
, setuptools._vendor.importlib_resources.simple.ResourceHandle
Return True if self is a file
setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.ChildPath
, setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.OrphanPath
, setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.SpecPath
, setuptools._vendor.importlib_resources.readers.MultiplexedPath
, setuptools._vendor.importlib_resources.simple.ResourceContainer
Yield Traversable objects in self
setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.ChildPath
, setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.OrphanPath
, setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.SpecPath
, setuptools._vendor.importlib_resources.readers.MultiplexedPath
, setuptools._vendor.importlib_resources.simple.ResourceHandle
Return Traversable resolved with any descendants applied. Each descendant should be a path segment relative to self and each may contain multiple levels separated by ``posixpath.sep`` (``/``).
setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.ChildPath
, setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.OrphanPath
, setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.SpecPath
, setuptools._vendor.importlib_resources.readers.MultiplexedPath
, setuptools._vendor.importlib_resources.simple.ResourceContainer
, setuptools._vendor.importlib_resources.simple.ResourceHandle
mode may be 'r' or 'rb' to open as text or binary. Return a handle suitable for reading (same as pathlib.Path.open). When opening as text, accepts encoding parameters such as those accepted by io.TextIOWrapper.
setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.ChildPath
, setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.OrphanPath
, setuptools._vendor.importlib_resources._adapters.CompatibilityFiles.SpecPath
, setuptools._vendor.importlib_resources.readers.MultiplexedPath
, setuptools._vendor.importlib_resources.simple.ResourceHandle
The base name of this object without any parent references.