I used a the recipe
(http://aspn.activestate.com/ASPN/Coo.../Recipe/198078<http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/198078>)
used to wrap methods for logging purposes. logging classes. But it does seem
to work well with classes inherit form other classes - i get recursion
errors!
Here is an example of the classes ..
class Base(MetaClass):
class BFrame(BaseFrame):
def __init__(self, pathname=''):
Base.__init__(self, pathname = pathname)
When i instatiate BiasFrame()
below is the OUTPUT
logmethod <BFrame object at 0x9c32d90> __init__ () {}
logmethod <BFrame object at 0x9c32d90> __init__ () {'pathname': ''}
logmethod <BFrame object at 0x9c32d90> __init__ () {'pathname': ''}
logmethod <BFrame object at 0x9c32d90> __init__ () {'pathname': ''}
logmethod <BFrame object at 0x9c32d90> __init__ () {'pathname': ''}
.
.
RuntimeError: maximum recursion depth exceeded in cmp
It starts with the __init__ of BFrame, that's correct. In the __init__ of
BFrame is a call to Base.__init__ with the pathname as argument. That is the
second call to __init__ in the output, but the class is wrong ! Instead of
the __init__ of Base the __init__ of BFrame is called.
is there any way i can correct this?
--
+= Johnson
--------------------------------------
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor