<br><br><div class="gmail_quote">On Wed, Jun 13, 2012 at 1:18 AM, Nick Coghlan <span dir="ltr">&lt;<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.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 Wed, Jun 13, 2012 at 11:10 AM, Brett Cannon &lt;<a href="mailto:brett@python.org">brett@python.org</a>&gt; wrote:<br>
&gt;&gt; &gt; This does mean, though, that imp.cache_from_source() and<br>
&gt;&gt; &gt; imp.source_from_cache() might need to be updated to raise a reasonable<br>
&gt;&gt; &gt; exception when sys.implementation.cache_tag is set to None as I believe<br>
&gt;&gt; &gt; right now it will raise a TypeError because None isn&#39;t a str. But what<br>
&gt;&gt; &gt; to<br>
&gt;&gt; &gt; raise instead? TypeError? EnvironmentError?<br>
&gt;&gt; NotImplementedError seems fine for me too if we don&#39;t end up using this<br>
&gt;&gt; flag.<br>
&gt;<br>
&gt; OK, that&#39;s 2 votes for that exception.<br>
<br>
</div>+ 1 from me as well, both for skipping any implicit reading or writing<br>
of the cache when cache_tag is None (IIRC, that&#39;s the use case we had<br>
in mind when we allowed that field to be None in the PEP 421<br>
discussion), and for *explicit* attempts to access the cache when the<br>
tag is None triggering NotImplementedError.<br>
<br>
That way people are free to use either LBYL (checking cache_tag) or<br>
EAFP (catching NotImplementedError).<br></blockquote><div><br></div><div>I&#39;m sold: <a href="http://bugs.python.org/issue15056">http://bugs.python.org/issue15056</a> for tracking the change. </div></div>

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