[Python-ideas] Simpler namespace packages
scialexlight at gmail.com
Tue Jun 21 03:24:27 CEST 2011
Sorry mixed up first and second examples
On Jun 20, 2011 12:24 PM, "Mike Graham" <mikegraham at gmail.com> wrote:
> On Mon, Jun 20, 2011 at 10:26 AM, Alex Light <scialexlight at gmail.com>
>> On Mon, Jun 20, 2011 at 10:03 AM, Mike Graham <mikegraham at gmail.com>
>>> Would it be possible to allow a more simple definition, for example
>>> putting the dot itself in the filename? Where these would be similar?
>>> __init__.py #empty
>> I fail to see how the first example is clearer than the second. Indeed
>> the opposite seems to be true.
>> What i think you need to understand is that the name of the module is the
>> same as the path to it.
>> IMO the current system emphasizes that very strongly and this proposal
>> only make the
>> concept less clear.
> The first example ISN'T clearer than the second. I think the second is
> more easily understood to be sure. The first example, I'm saying, may
> be clearer than other implementations of namespace packages, not
> clearer than a normal package.
> A namespace package is one where the top level(s) aren't for a normal
> package. If foo.bar and foo.baz and foo.qux were distributed
> completely separately, foo would be a namespace package.
> Currently, a namespace package might look like
> foo/ # No __init__.py in foo
> foo.bar-1.2.3-py2.7-nspkg.pth # A pth file to tell Python how to
> import the package
> namespace_packages.txt # This would say "foo" in it
> ....other stuff
> and PEP382 tries to improve the situation a bit. I'm hoping we can
> come up with something that is easily understood.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas