Multiple hierarchie and method overloading

bruno at modulix onurb at xiludom.gro
Tue Apr 25 05:07:26 EDT 2006


Philippe Martin wrote:
> Hi,
> 
> 
> 
> 
> I have something like this:
> 
> Class A:
>         def A_Func(self, p_param):
>          .....
> Class B:
>         def A_Func(self):
>          .....
> 
> Class C (A,B):
>         A.__init__(self)

If that's really your code, you should have an exception right here.
Else, please post real code.


>         B.__init__(self)


> .....
> 
>         self.A_Func() #HERE I GET AN EXCEPTION "... takes at least 2 arguments (1
> given).


> 
> I renamed A_Func(self) to fix that ... but is there a cleaner way around ?

Perhaps should you read these texts:

http://diveintopython.org/object_oriented_framework/defining_classes.html
http://www.freenetpages.co.uk/hp/alan.gauld/tutclass.htm
http://docs.python.org/tut/node11.html


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list