Re: Name conflict in class hierarchy

2006-05-23 Thread bruno at modulix
Scott David Daniels wrote: > bruno at modulix wrote: > >> Ralf Muschall wrote: >> >>> Jeffrey Barish wrote: >>> >>> [overriding of base class member functions by subclass] >>> In Python, a function not intended to be overriden should be either >>> have a name starting with an underscore >> >>

Re: Name conflict in class hierarchy

2006-05-23 Thread Michele Simionato
Jeffrey Barish wrote: > I believe that the answer to my question is no, but I want to be sure that I > understand this issue correctly: Suppose that there are two classes > defined as follows: > > class A(object): > def f1(self): > print 'In A.f1, calling func' > self.func() >

Re: Name conflict in class hierarchy

2006-05-23 Thread Ralf Muschall
bruno at modulix wrote: >> In Python, a function not intended to be overriden should be either >> have a name starting with an underscore > actually with *two* underscores. The single-leading-underscore naming > scheme is the convention for 'protected' (read: 'implementation, not > API') attribut

Re: Name conflict in class hierarchy

2006-05-22 Thread Scott David Daniels
bruno at modulix wrote: > Ralf Muschall wrote: >> Jeffrey Barish wrote: >> >> [overriding of base class member functions by subclass] >> In Python, a function not intended to be overriden should be either >> have a name starting with an underscore > > actually with *two* underscores. The sing

Re: Name conflict in class hierarchy

2006-05-22 Thread bruno at modulix
Ralf Muschall wrote: > Jeffrey Barish wrote: > > [overriding of base class member functions by subclass] > (snip) > > In Python, a function not intended to be overriden should be either > have a name starting with an underscore actually with *two* underscores. The single-leading-underscore nami

Re: Name conflict in class hierarchy

2006-05-21 Thread Scott David Daniels
Jeffrey Barish wrote: > Suppose that there are two classes defined as follows: > > class A(object): > def f1(self): > print 'In A.f1, calling func' > self.func() > > def func(self): > print 'In A.func' > > class B(A): > def func(self): > print 'In B.fu

Re: Name conflict in class hierarchy

2006-05-20 Thread Ralf Muschall
Jeffrey Barish wrote: [overriding of base class member functions by subclass] > but then B does not inherit other functions of A that I would like to use. > It struck me that this must be a common problem in OOP, so I'm wondering > whether there is a simple solution that I am missing. In C++, o

Re: Name conflict in class hierarchy

2006-05-20 Thread Larry Bates
Jeffrey Barish wrote: > I believe that the answer to my question is no, but I want to be sure that I > understand this issue correctly: Suppose that there are two classes > defined as follows: > > class A(object): > def f1(self): > print 'In A.f1, calling func' > self.func() >

Name conflict in class hierarchy

2006-05-20 Thread Jeffrey Barish
I believe that the answer to my question is no, but I want to be sure that I understand this issue correctly: Suppose that there are two classes defined as follows: class A(object): def f1(self): print 'In A.f1, calling func' self.func() def func(self): print 'In