A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20110705/6625e35e/attachment.html below:

<p>Exception is for catching, not raising.</p>
<div class="gmail_quote">On Jul 4, 2011 11:57 AM, &quot;Victor Stinner&quot; &lt;<a href="mailto:victor.stinner@haypocalc.com">victor.stinner@haypocalc.com</a>&gt; wrote:<br type="attribution">&gt; Le lundi 04 juillet 2011 à 18:23 +0200, Antoine Pitrou a écrit :<br>
&gt;&gt; On Mon, 04 Jul 2011 18:06:53 +0200<br>&gt;&gt; victor.stinner &lt;<a href="mailto:python-checkins@python.org">python-checkins@python.org</a>&gt; wrote:<br>&gt;&gt; &gt; <a href="http://hg.python.org/cpython/rev/7eef821ab20d">http://hg.python.org/cpython/rev/7eef821ab20d</a><br>
&gt;&gt; &gt; changeset:   71197:7eef821ab20d<br>&gt;&gt; &gt; user:        Victor Stinner &lt;<a href="mailto:victor.stinner@haypocalc.com">victor.stinner@haypocalc.com</a>&gt;<br>&gt;&gt; &gt; date:        Mon Jul 04 18:06:35 2011 +0200<br>
&gt;&gt; &gt; summary:<br>&gt;&gt; &gt;   Issue #12469: replace assertions by explicit if+raise<br>&gt; <br>&gt; <br>&gt;&gt; Instead of generic Exception, it would be better to use AssertionError.<br>&gt; <br>&gt; and<br>
&gt; <br>&gt;&gt; or in many cases given this was in unittests... use the self.assertFoo<br>&gt;&gt; methods and avoid assert and if statements all together.<br>&gt; <br>&gt; The code is running in a subprocess (python -c ...), not in an<br>
&gt; unittest.TestCase, so I cannot use self.assertFoo and it doesn&#39;t really<br>&gt; matter if the exception is an Exception or an AssertionError.<br>&gt; <br>&gt;&gt; What is the reason for this change anyway -- as far as I can<br>
&gt;&gt; see this code is never run with -O.<br>&gt; <br>&gt; I&#39;m not sure that the code will never be running using -O, so I prefer<br>&gt; to use an explicit if+raise. I don&#39;t like the assert statement because<br>
&gt; it doesn&#39;t provide any information about the failure (content of the<br>&gt; variables) by default.<br>&gt; <br>&gt; Victor<br>&gt; <br>&gt; _______________________________________________<br>&gt; Python-Dev mailing list<br>
&gt; <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>&gt; <a href="http://mail.python.org/mailman/listinfo/python-dev">http://mail.python.org/mailman/listinfo/python-dev</a><br>&gt; Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/guido%40python.org">http://mail.python.org/mailman/options/python-dev/guido%40python.org</a><br>
</div>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4