Re: mutlifile inheritance problem

2013-09-20 Thread Chris Angelico
On Sat, Sep 21, 2013 at 10:17 AM, Peter Cacioppi wrote: > It's too bad, I really lean on reload(). It appears to be incompatible with > inheritance more than one level deep. Python's really not designed for reload of this nature. You can easily make a nasty mess of things. If you're working in t

Re: mutlifile inheritance problem

2013-09-20 Thread Peter Cacioppi
On Thursday, March 21, 2002 2:03:23 PM UTC-7, Marc wrote: > I have classes defined in different files and would like to inherit > from a class in file A.py for a class in file B.py but am running into > problems. I'm using Python 1.5.2 on Windows NT > > Here's a specific example: > > ***

Re: mutlifile inheritance problem

2013-09-18 Thread Steven D'Aprano
On Wed, 18 Sep 2013 20:38:10 -0400, Ned Batchelder wrote: > super() takes a class and an instance for a reason. If you could use > self.__class__ for the class, then it would only take the instance. > Super() needs to know the instance, but also needs to know the class > it's being called from. Y

Re: mutlifile inheritance problem

2013-09-18 Thread Ned Batchelder
On 9/18/13 7:54 PM, Peter Cacioppi wrote: This is a very old topic, but here is a trick for single inheritance. (The problem you allude to isn't restricted to multiple inheritance). Any class with a single parent simply defines this function. def mySuper(self) : return super(sel

Re: mutlifile inheritance problem

2013-09-18 Thread Peter Cacioppi
One more comment - my trick has some utility with multiple inheritance, but you really need to understand super() to and method resolution ordering in that case (as, I suppose, you ought to whenever you cross the Rubicon beyond single inheritance). So it's a nice trick but YMMV On Wednesday, Se

Re: mutlifile inheritance problem

2013-09-18 Thread Peter Cacioppi
This is a very old topic, but here is a trick for single inheritance. (The problem you allude to isn't restricted to multiple inheritance). Any class with a single parent simply defines this function. def mySuper(self) : return super(self.__class__, self) And then any parent