I failed to sublcass pathlib.Path
, see my question here
Hacky solutions were offered, the linter complains about them. What I'm doing at the moment is this:
from pathlib import Path
class ExtendedPath:
def __init__(self, path):
self.orig_path_object = Path(path)
So, no inheritance from path. But now in order to access methods of Path I have to refer to the attribute orig_path_object
which is not convenient.
My question: I wonder if there is an elegant way to make methods of Path
available to ExtendedPath
without inheritence, specifically, through the orig_path_object
.