[issue45649] Add tarinfo.Path

Jason R. Coombs report at bugs.python.org
Sat Jan 1 18:19:11 EST 2022


Jason R. Coombs <jaraco at jaraco.com> added the comment:

I'd recommend not to block on issue24132. It's not obvious to me that subclassing would be valuable. It depends on how it's implemented, but in my experience, zipfile.Path doesn't and cannot implement the full interface of pathlib.Path. Instead zipfile.Path attempts to implement a protocol. At the time, the protocol was undefined, but now there exists importlib.resources.abc.Traversable (https://docs.python.org/3/library/importlib.html#importlib.abc.Traversable), the interface needed by importlib.resources. I'd honestly just create a standalone class, see if it can implement Traversable, and only then consider if it should implement a more complicated interface (such as something with symlink support or perhaps even later subclassing from pathlib.Path).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45649>
_______________________________________


More information about the Python-bugs-list mailing list