<br><br><div class="gmail_quote">On Thu, Jul 23, 2009 at 20:18, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
So, I guess, we'll live with it for a while longer. Given that it<br>
managed to evade our attention for so long, I think that's fine.<br>
</blockquote><div><br></div><div>Can someone double-check me that the semantics can even be triggered in 3.1? I just tried and couldn't come up with anything. Heck, I quick search for a Py_None comparison in 3.1's import.c turned up nothing useful (other than mark_miss() is the function used to set None in sys.modules). We might have actually already removed it or made it so that the semantics can't be triggered.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
I agree that there's no reason for a None result from loaders to be<br>
interpreted the same way, assuming that's not how it works ATM.<br>
<br>
And we can live with import and importlib differing on this in 3.1<br>
(though you could call it a bug in importlib and fix it for 3.1.1 --<br>
not sure if you were planning on that).<br>
<font color="#888888"></font></blockquote><div><br></div><div>I can if people can trigger the semantics somehow so I have a test to go by.</div><div><br></div><div>-Brett</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font color="#888888"><br>
--Guido<br>
</font><div><div></div><div class="h5"><br>
On Thu, Jul 23, 2009 at 7:50 PM, Brett Cannon<<a href="mailto:brett@python.org">brett@python.org</a>> wrote:<br>
><br>
><br>
> On Thu, Jul 23, 2009 at 19:48, Benjamin Peterson <<a href="mailto:benjamin@python.org">benjamin@python.org</a>><br>
> wrote:<br>
>><br>
>> 2009/7/23 Brett Cannon <<a href="mailto:brett@python.org">brett@python.org</a>>:<br>
>> ><br>
>> ><br>
>> > On Thu, Jul 23, 2009 at 19:38, Benjamin Peterson <<a href="mailto:benjamin@python.org">benjamin@python.org</a>><br>
>> > wrote:<br>
>> >><br>
>> >> 2009/7/23 Brett Cannon <<a href="mailto:brett@python.org">brett@python.org</a>>:<br>
>> >> > None in Python 3.1 is really useless in terms of its semantics in<br>
>> >> > relative<br>
>> >> > imports; importlib doesn't support it and still passes as __import__<br>
>> >> > (at<br>
>> >> > least last time I ran the test suite that way). I thought we had<br>
>> >> > agreed<br>
>> >> > a<br>
>> >> > while back that supporting None was not warranted in Python 3.0?<br>
>> >> > Otherwise I<br>
>> >> > will do whatever work is necessary for this to happen.<br>
>> >><br>
>> >> I think it's still nice for the rare cases where you need to trick a<br>
>> >> module into thinking another one doesn't exist.<br>
>> ><br>
>> > But None does not strictly mean "I don't exist". None is supposed to<br>
>> > trigger<br>
>> > an another import attempt for the module with a top-level name. It's<br>
>> > that<br>
>> > extra import trigger that has no real use in 3.0 and just complicates<br>
>> > import<br>
>> > semantics (IMO) needlessly. If you want a module to not exist then you<br>
>> > either stick something else in (e.g. '42') or we remove the special<br>
>> > semantics for None (which I thought we had).<br>
>><br>
>><br>
>> I didn't realize None had other semantics attached to it. (Imagine<br>
>> that dealing with import!) +1 for making it simply indicate an<br>
>> ImportError.<br>
><br>
> I'm +0 with having import raise ImportError if None is set in sys.modules as<br>
> long as we don't suddenly expect loaders to trigger the same thing if they<br>
> return None (actually, as of right now what loaders return count for<br>
> nothing, but just want to be clear).<br>
> -Brett<br>
<br>
<br>
<br>
</div></div><div><div></div><div class="h5">--<br>
--Guido van Rossum (home page: <a href="http://www.python.org/~guido/" target="_blank">http://www.python.org/~guido/</a>)<br>
</div></div></blockquote></div><br>