<div class="gmail_quote">On Thu, May 3, 2012 at 6:20 PM, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>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. </p>
<p>If we say "this is the stdlib convention" people are going to start using the same check as is now used in traceback.py</p>
<p>The precedent is there with code objects, and I think it's a good example to follow.<br></p></blockquote></div>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.<br>
<br>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.<br>
<br>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?<br>
<br>