The Music Guy wrote:
...
def main():
...
class MyMixin(object):
This is a mistake. If Mixins inherit from CommonBase as well, no
order of class definition can catch you out.
If it doesn't, you can get yourself in trouble.
def method_x(self, a, b, c):
super(MyMixin, self).met
On Sep 9, 7:48 pm, The Music Guy wrote:
> Btw, Carl, please forgive me if I frustrate you, because I'm trying my
> best not to. I'm trying to keep track of what I did and what you did
> and what Ryles and Scott did, while at the same time trying to keep a
> firm grasp of exactly what it is I'm try
On Sep 9, 4:37 pm, The Music Guy wrote:
> On Wed, Sep 9, 2009 at 1:21 PM, Carl Banks wrote:
> > On Sep 8, 10:47 pm, The Music Guy wrote:
> > What is get_other_base? Just use a regular super call here,
> > get_other_base and hacks like that are what gets you into trouble.
>
> > You seem to be ove
Btw, Carl, please forgive me if I frustrate you, because I'm trying my
best not to. I'm trying to keep track of what I did and what you did
and what Ryles and Scott did, while at the same time trying to keep a
firm grasp of exactly what it is I'm trying to acheive. Besides that,
I'm not a professio
On Wed, Sep 9, 2009 at 1:21 PM, Carl Banks wrote:
> On Sep 8, 10:47 pm, The Music Guy wrote:
> What is get_other_base? Just use a regular super call here,
> get_other_base and hacks like that are what gets you into trouble.
>
> You seem to be overthinking this. You don't need to. Just use supe
On Sep 8, 10:47 pm, The Music Guy wrote:
> I should also mention--and I should have realized this much
> sooner--that each of the BaseN classes are themselves each going to
> have at least one common base which will define method_x, so each
> BaseN will be calling that if it defines its own method
On Sep 9, 1:47 am, The Music Guy wrote:
> I should also mention--and I should have realized this much
> sooner--that each of the BaseN classes are themselves each going to
> have at least one common base which will define method_x, so each
> BaseN will be calling that if it defines its own method_
I should also mention--and I should have realized this much
sooner--that each of the BaseN classes are themselves each going to
have at least one common base which will define method_x, so each
BaseN will be calling that if it defines its own method_x. Again,
sorry I didn't mention that sooner. For
On Mon, Sep 7, 2009 at 3:30 PM, Carl Banks wrote:
>
> That's not what you did in your original post, though.
>
> Mixins should be listed first among bases, which is how you did it in
> your original post, and how it had to be in order for it to "just
> work" as I claimed.
>
> class FooX(MyMixin, Ba
On Sep 6, 10:48 pm, The Music Guy wrote:
> Sorry, that last code had a typo in it:
>
> #!/usr/bin/python
>
> def main():
> foox = FooX()
> fooy = FooY()
> fooz = FooZ()
>
> foox.method_x("I", "AM", "X")
> print
> fooy.method_x("ESTOY", "Y", "!")
> print
> fooz.metho
Sorry, that last code had a typo in it:
#!/usr/bin/python
def main():
foox = FooX()
fooy = FooY()
fooz = FooZ()
foox.method_x("I", "AM", "X")
print
fooy.method_x("ESTOY", "Y", "!")
print
fooz.method_x(100, 200, 300)
class MyMixin(object):
def method_x(self,
On Sat, Sep 5, 2009 at 8:41 PM, Carl Banks wrote:
> Out of curiosity, did you try this and are reporting that it resulted
> in an AttributeError, or did you merely deduce that it would raise
> AttributeError based on your knowledge of Python's inheritance?
>
> I ask this rhetorically. I know that
On Sep 4, 3:01 am, The Music Guy wrote:
> I have a peculiar problem that involves multiple inheritance and method
> calling.
>
> I have a bunch of classes, one of which is called MyMixin and doesn't
> inherit from anything. MyMixin expects that it will be inherited along
> with one of several oth
On Sep 4, 6:01 am, The Music Guy wrote:
> I have a peculiar problem that involves multiple inheritance and method
> calling.
>
> I have a bunch of classes, one of which is called MyMixin and doesn't
> inherit from anything. MyMixin expects that it will be inherited along
> with one of several oth
On Fri, Sep 4, 2009 at 11:23 AM, Scott David
Daniels wrote:
> The Music Guy wrote:
>>
>> I have a peculiar problem that involves multiple inheritance and method
>> calling.
>>
>> I have a bunch of classes, one of which is called MyMixin and doesn't
>> inherit from anything. MyMixin expects that it
The Music Guy wrote:
I have a peculiar problem that involves multiple inheritance and method calling.
I have a bunch of classes, one of which is called MyMixin and doesn't
inherit from anything. MyMixin expects that it will be inherited along
with one of several other classes that each define ce
I have a peculiar problem that involves multiple inheritance and method calling.
I have a bunch of classes, one of which is called MyMixin and doesn't
inherit from anything. MyMixin expects that it will be inherited along
with one of several other classes that each define certain
functionality. It
17 matches
Mail list logo