Re: PEP 420: Implicit Namespace Packages
PJ Eby <[email protected]>
| Newsgroups | gmane.comp.python.import |
|---|---|
| Message-ID | <CALeMXf7x9sZEb1OSW3JE5Cgo23eH6oye+M2ghpL+xwtbEVDtEg@mail.gmail.com> |
On Thu, May 3, 2012 at 6:20 PM, Nick Coghlan <[email protected]> wrote: > I'd still prefer to just officially bless the existing "<whatever>" > convention for non-filesystem imports over encouraging type checks on > __loader__ or defining a new introspection interface for loaders. > > If we say "this is the stdlib convention" people are going to start using > the same check as is now used in traceback.py > > The precedent is there with code objects, and I think it's a good example > to follow. > Note that this messes with the idea of using the first directory as filename -- anybody who joins with os.path.dirname(__file__) is going to get a mess (on regular filesystem paths), which is (I'm guessing) why the trailing separator idea was proposed in the first place. Which kind of brings us full circle on that point. I suppose we could just say screw it, anybody implementing VFS importers had darn well better understand os.path.join and friends, since PEP 302 requires it for get_data anyway. Still seems like a wart, but oh well. OTOH, maybe it's better for people munging __file__ to get a weird error all the time with namespace packages, instead of something that works some of the time, and fails later? _______________________________________________ Import-SIG mailing list [email protected] http://mail.python.org/mailman/listinfo/import-sig