<div dir="ltr"><div><div>I just tried your code with similar results: it does nothing on PyPy 2.0.0-beta2 and Python 2.7.4. But on Python 3.3.1 it caused core dump.<br></div>It's a little weird but so is the code. You have defined a function that calls itself unconditionally. This will cause a stack overflow, which is a RuntimeError.<br>
</div><div> Since you are handling this very exception with a pass statement, we would expect that no error occurs. But the fatal error message seems pretty informative at this point: "Cannot recover from stack overflow.".<br>
<br>One thing to note is that while it's reasonable to handle exceptions that happens at the level of your Python code, like a ValueError, it's not so reasonable to try to handle something that may disturb the interpreter itself in a lower level, like a stack overflow (I think that the stack used by your code is the same stack used by the interpreter code, but I'm not sure).<br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/29 Joshua Landau <span dir="ltr"><<a href="mailto:joshua.landau.ws@gmail.com" target="_blank">joshua.landau.ws@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hello all, again. Instead of revising like I'm meant to be, I've been delving into a bit of Python and I've come up with this code:<div><br></div><div><div><div>class ClassWithProperty:</div><div>


<span style="white-space:pre-wrap">     </span>@property</div><div><span style="white-space:pre-wrap">        </span>def property(self):</div><div><span style="white-space:pre-wrap">              </span>pass</div><div><br></div><div>

thingwithproperty = ClassWithProperty()</div><div><br></div><div>def loop():</div><div><span style="white-space:pre-wrap">    </span>try:</div><div><span style="white-space:pre-wrap">             </span>thingwithproperty.property</div>


<div><span style="white-space:pre-wrap">  </span>except:</div><div><span style="white-space:pre-wrap">          </span>pass</div><div><br></div><div><span style="white-space:pre-wrap">    </span>loop()</div><div><br></div>

<div>try:</div><div><span style="white-space:pre-wrap">       </span>loop()</div><div>except RuntimeError:</div><div><span style="white-space:pre-wrap">        </span>pass</div></div></div><div><br></div><div>As you will expect, this does nothing... on Python2.7 and PyPy. Python3.3 prefers to spit out a "Fatal Python error: Cannot recover from stack overflow.", which seems a bit unexpected.</div>


<div><br></div><div>Wuzzup with that?</div></div>
<br>--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
<br></blockquote></div><br></div>