[Zope-dev] New-style ExtensionClass

Jim Fulton jim at zope.com
Wed Oct 22 06:58:16 EDT 2003


Florent Guillaume wrote:

...

> Excellent.
> Will it also fix this particularity of ExtensionClass:
> 
> 
>>>>from ExtensionClass import Base
> 
> ... class A(Base):
> ...   def foo(self):
> ...     self.gee
> ...   def bar(self):
> ...     del self.gee
> ... 
> 
>>>>a=A()
>>>>a.foo()
> 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "<stdin>", line 3, in foo
> AttributeError: gee
> 
>>>>a.bar()
> 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "<stdin>", line 5, in bar
> KeyError: gee
> 
> I.e., the fact that KeyError is raised whereas a normal class would
> raise AttributeError.


... Jim makes a unit test ...

Yes. :)

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org




More information about the Zope-Dev mailing list