[Zope] Zope Stability Question

Pavlos Christoforou pavlos@gaaros.com
Thu, 9 Mar 2000 22:34:49 -0500 (EST)


On 9 Mar 2000, Ty Sarna wrote:

> In article <38C7D8EF.E8E2BA4E@kw.igs.net>, JB  <jimbag@kw.igs.net> wrote:
> > forced to, won't support it. I've had Zope and numerous other programs
> > in Python running without one crash EVER! Believe it!
> 
> You *can* actually get Python to crash if you're intentionally mean to
> it.  All the ways I know of involve tricking it into blowing the C
> stack, like:
> 
> 	class C:
> 	    pass
> 
> 	C.__init__ = C; C()
> 
> Not that you could expect that construct to do anything useful anyway;
> you wouldn't ever see code like that in an application.
> 
> You have to go out of your way doing really bizarre stuff get it to crash.
> It's very stable otherwise.  :-)

I don't think you need to really get out of your way to crash python. For
someone discovering __getattr__ for the first time and wanting to do some
simple delegation ...

class A:
    def __init__(self):
        self.a=[]
    def __getattr__(self,key):
        if hasattr(self.a,key):
            return getattr(self.a,key)
        else:
            return getattr(self,key)

Wrong but not really bizzare IMO

Pavlos