<br><br><div class="gmail_quote">On Wed, May 23, 2012 at 9:10 AM, Eric V. Smith <span dir="ltr">&lt;<a href="mailto:eric@trueblade.com" target="_blank">eric@trueblade.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On 05/23/2012 09:02 AM, Nick Coghlan wrote:<br>
&gt; On Wed, May 23, 2012 at 10:31 PM, Eric V. Smith &lt;<a href="mailto:eric@trueblade.com">eric@trueblade.com</a>&gt; wrote:<br>
&gt;&gt; On 05/22/2012 09:49 PM, PJ Eby wrote:<br>
&gt;&gt;&gt; It shouldn&#39;t - all you should need is to use<br>
&gt;&gt;&gt; getattr(sys.modules[self.modname], self.attr) instead of referencing a<br>
&gt;&gt;&gt; parent path object directly.<br>
&gt;&gt;<br>
&gt;&gt; The problem isn&#39;t the lookup, it&#39;s coming up with self.modname and<br>
&gt;&gt; self.attr. As it currently stands, PathFinder.find_module is given the<br>
&gt;&gt; parent path, not the module name and attribute name used to look up the<br>
&gt;&gt; parent path using sys.modules and getattr.<br>
&gt;<br>
&gt; Right, that&#39;s what PJE and I were discussing. Instead of passing in<br>
&gt; the path object directly, you can instead pass an object that *lazily*<br>
&gt; retrieves the path object in its __iter__ method:<br>
<br>
</div>Hey, one message at a time! I&#39;m just reading those now.<br>
<br>
I&#39;d like to hear Brett&#39;s comments on this approach.</blockquote><div><br></div><div>If I understand the proposal correctly, this would be a change in NamespaceLoader in how it sets __path__ and in no way affect any other code since __import__() just grabs the object on __path__ and passes as an argument to the meta path finders which just iterate over the object, so I have no objections to it.</div>

<div><br></div><div>-Brett</div></div>

AltStyle によって変換されたページ (->オリジナル) /