Re: PEP 420: Implicit Namespace Packages

Barry Warsaw <[email protected]>
Newsgroups gmane.comp.python.import
Organization Damn Crazy Followers of the Horn
Message-ID <[email protected]>
On May 04, 2012, at 10:56 AM, PJ Eby wrote:

>On May 4, 2012 10:34 AM, "Barry Warsaw" <[email protected]> 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.

Cheers,
-Barry

_______________________________________________
Import-SIG mailing list
[email protected]
http://mail.python.org/mailman/listinfo/import-sig
signature.asc (application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJPpCnKAAoJEBJutWOnSwa/60oQAI4z1sww3pTL8g6QgubJnLmW
+6Sy+QLlJMKwGgYVD1lUvvdjxRXzRxj7XT+lhmxa32IDuF3pS8zzuItGkRqOZn33
+RJrCL9oBc6fAXsOvg/Iqo++bqeIfAknBhSjoI378GtsA7rY7+lY7Gcq157oDvrS
3vGCRDBpjy6rtNM0le0JC8Jqo52yhKgztuV84gUOYuZEDg1hzxqDQPNIpAeKRHg3
10l/t4bpQ339AFgBtRK1nQXvHXl3XyXZY6J77G6FBqm9/hAIqAbZFkKCZsS0ZiL5
mCmyCLXgccq6GJAe6m1sPyp2MOWkNPsV/fmKXuG+vW8JIHKdqk1Uweu7afWVr6PG
Z7XkGz0qUo95b9hrSgd/4NFtZMvnNnNDMBhJh+GYlAsShVnBUxyZmnD+cc9xOPlJ
MO4vt53wC3L8FiFA0bRW01wMKlktVObt7d2eBnBVzomjoAl1WuRRs3+b1tx68TfN
EtQDHCE/BPCPe0mHQaNfoMkPsPgwDXw7PcemHxi6RVOqnJzITl3x90xgu6sTfakY
72BiZ9HXGA0rBprDaoz/ridqxGJWtkJxk1aPaaJRWXoFgiZoJt/cwhZLsGg7jc1d
6qRQLeTPUX2hrdl4fr81x/u4jDejoiu4OLqMCTGEzgFKREREm4/nRwK4Shx5twHt
SRtynyVb8U75yfV6jBMN
=9QFT
-----END PGP SIGNATURE-----
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.