Fatal Python error

Joshua Landau joshua.landau.ws at gmail.com
Wed May 29 08:43:48 EDT 2013


On 29 May 2013 13:25, Dave Angel <davea at davea.name> wrote:

> On 05/29/2013 07:48 AM, Joshua Landau wrote:
>
>> 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:
>>
>>
> To start with, please post in text mode.  By using html, you've completely
> messed up any indentation you presumably had.


Appologies, I use GMail and I don't know how to force text-only


>  class ClassWithProperty:
>>   @property
>> def property(self):
>> pass
>>
>
> Did you really mean to hide the built-in property?  I don't know if this
> does that, but it's certainly confusing.  And perhaps that's a difference
> between 2.x and 3.x


I'm not. That goes to self.property, whilst the normal function isn't. I
guess it does locally hide it, but who really cares? :P

You can rename it if you want. Anything will do. Obviously this is a
minimal example code, and not the real thing.

 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.
>>
>>
> A stack overflow means you have infinite recursion.


I realise, but I was hoping to catch that with the "except RuntimeError".


> Try fixing the property name above, and see if that makes a difference.


It does not make a difference.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130529/2b7b1e5f/attachment.html>


More information about the Python-list mailing list