<br><br><div class="gmail_quote">On Wed, Jul 15, 2009 at 06:51, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com">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;">
<div class="im">Antoine Pitrou wrote:<br>
> I am not sure when this discussion started. Are you replying to a 3 month-old<br>
> message of yours? :)<br>
<br>
</div>That depends on how you define the beginning of the discussion...<br>
</blockquote><div><br></div><div>Especially since I was offlist three months ago. =)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
However, the fact that importlib doesn't implement the comparatively<br>
recent get_filename() optional extension documented in PEP 302 came up<br>
in one of the PEP 376 threads within the last week or so.<br>
<div class="im"></div></blockquote><div><br></div><div>I have been ignoring the PEP 372 discussions since I came into it late and I don't deal with packaging enough to want to influence the discussion, so I missed that point being made.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
> In any case, keeping all import-related ABCs in a single place sounds like a<br>
> good idea.<br>
> Alternatively, if the method is runpy specific, it doesn't have its place in an<br>
> ABC, does it?<br>
<br>
</div>While runpy is the only client in the standard library for the<br>
get_filename() method, the method is still a PEP 302 extension. I<br>
documented the extension in the PEP as loaders are the only things<br>
reliably in a position to provide the filename details that runpy needs<br>
to set __file__ and sys.argv[0] correctly and until importlib came along<br>
PEP 302 itself was the only real documentation of that API.<br>
<br>
Since importlib is now the "go-to" location for people that want to<br>
write their own PEP 302 importers and loaders, I would say that it is<br>
also the right place for the new ExecutionLoader ABC.</blockquote><div><br></div><div>OK. I will add an ExecutionLoader ABC to importlib that simply subclasses InspectLoader and adds the get_filename() abstract method. Thanks to everyone for their feedback.</div>
<div><br></div><div>-Brett</div></div>