Re: making it feasible to rely on loaders for reading intra-package data files

Paul Moore <[email protected]> Mon, 3 Feb 2014 17:47:16 +0000
Newsgroups gmane.comp.python.import
Message-ID <CACac1F9cY7LxfD=w1r0K18_Ba67y3tJnRVKN5UofpMOuSfMmzQ@mail.gmail.com>
On 3 February 2014 16:54, Brett Cannon <[email protected]> wrote:
> Interesting idea, but I don't know how backwards-compatible it would be. But
> since pathlib itself has several subclasses I don't see why there couldn't
> be some way to construct something that understood what part of a path was a
> zipfile and what was a path within the zipfile.

Yeah, I had a play with it last night and it certainly looks
plausible. There's a backport of pathlib on PyPI that supports 2.7, so
backwards compatibility is reasonable. Partlib's internals are pretty
impressive - easy to hook into and extend. I have a sort-of proof of
concept, but I need to write some tests to find out if the code
actually does what I think it does (note to self - start actually
doing test-driven coding :-))

Paul