[Import-SIG] PEP 420: Implicit Namespace Packages

Barry Warsaw barry at python.org
Fri May 4 21:11:05 CEST 2012

On May 04, 2012, at 10:56 AM, PJ Eby wrote:

>On May 4, 2012 10:34 AM, "Barry Warsaw" <barry at python.org> wrote:
>> Specifically, my proposed elaboration on PEP 420 is this:
>>  * Explicitly leave the assignment of __file__ to the loader.
>>  * Allow loaders to not set __file__
>>  * Add an optional API to loaders, module_repr() as defined above.
>+1 on all the above, plus getting rid of __file__ for namespace packages.
>Seems like an elegant solution to the problems involved, and allows DB or
>other importers to make their own attributes like __dsn__ or __url__, but
>still have a decent repr.

Yes, exactly.

It seems like there's general consensus about the basic proposal; I'll update
the PEP so Guido has specific language to pronounce on.

I want to make one change to what I posted.  If m.__loader__.module_repr()
exists, I want to give it a first crack at producing the repr.  This means
that __file__ is used as a fallback, not as the first step.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/import-sig/attachments/20120504/629b8420/attachment.pgp>

More information about the Import-SIG mailing list