Re: PEP 420 issue: extend_path

"Eric V. Smith" <[email protected]>
Newsgroups gmane.comp.python.import
Message-ID <[email protected]>
On 05/09/2012 02:48 AM, [email protected] wrote:

> I must have missed Nick's message where he explained it, so I still need
> to ask again: how exactly would such a zip file be structured?

I'll work on such an example. But I think Nick's example of a config
file that has the configuration for multiple portions of a single
namespace package is more compelling. I don't see where returning a list
for the common case of a single portion is a large burden.

> I fail to see the need to ever report both a loader and a portion,
> as well as the need to report multiple portions, for a single sys.path
> item. That sounds like an unnecessary complication.

As Nick said, you'd return a loader, a list of portions, or neither. it
would be an error to return both. I'm mildly sympathetic to not wanting
to inspect either the type or attributes of the returned value to figure
out which is being returned. A callback to specify the portions seem
needlessly complex and a hassle for a C implementation. My compromise is
to return a tuple. I don't think a tuple is much of a burden. It's not
like writing finders which support namespace portions will be a common
activity.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.