AFAIK, the best use case for multiple inheritance is the plugin
pattern,
when you plug in methods in a class according to a given condition.
For instance:
if plugin == "PDF":
class DocumentGenerator(BaseGenerator, PDFMixin): pass
elif plugin == "PS":
class DocumentGenerator(BaseGenerator,
"Michele Simionato" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> BTW, what it your use case? I have yet to see a single compelling use
> case for multiple inheritance, so I am
> curious of what your design is.
Before I start, I should mention that my workaround I listed previousl
In article <[EMAIL PROTECTED]>,
Michele Simionato <[EMAIL PROTECTED]> wrote:
>
>BTW, what it your use case? I have yet to see a single compelling use
>case for multiple inheritance, so I am curious of what your design is.
Dunno whether you'd call it compelling, but my current company uses
multiple
>Well, writing that book would be a major undertaking that I am not
>willing to take any soon ;)
Well at least you didn't say NO, so when you DO write the book I will
buy a copy.
>However, all you are asking for is already in my lectures at ACCU
How many people can say ' No book just these lecture
Well, writing that book would be a major undertaking that I am not
willing
to take any soon ;)
However, all you are asking for is already in my lectures at ACCU:
http://www.reportlab.org/~andy/accu2005/pyuk2005_simionato_wondersofpython.zip
>From the README:
"""
Generally speaking these lecture
Michele Simionato wrote:
> M.E. Farmer:
>
> >You would be surprised how many answers you can squeeze out of that
> one
> >URL.
> >That whole page is worth a month of study( for me anyway ).
>
> One month only? You must be pretty smart, one could easily extract
> a book from that page ;)
No, I was b
BTW, what it your use case? I have yet to see a single compelling use
case for multiple inheritance, so I am
curious of what your design is.
Michele Simionato
--
http://mail.python.org/mailman/listinfo/python-list
M.E. Farmer:
>You would be surprised how many answers you can squeeze out of that
one
>URL.
>That whole page is worth a month of study( for me anyway ).
One month only? You must be pretty smart, one could easily extract
a book from that page ;)
>I am still trying to grasp the 'purpose' of classm
John & Sarah:
> Incidentally, is it safe to have an mro() method in a class, > or is
this
> as reserved as the usual __reserved_words__? Does Python > use mro()
(as
> opposed to __mro__) internally or anything?
.mro() is a metamethod, it is a method of the metaclass, not of the
class. So you can o
Michele Simionato:
>> M.E.Farmer:
>
>> Your answer lies somewhere in this page ;)
>> http://www.python.org/2.2.2/descrintro.html
>
> Yes, when it refers to
>
> http://www.python.org/2.3/mro.html
>
> (section Bad Method Resolution Orders).
>
> In short, it is a feature, not a bug.
I wanted to th
I knew it was a feature but had only a few minutes to answer and was
playing it safe ;)
You would be surprised how many answers you can squeeze out of that one
URL.
That whole page is worth a month of study( for me anyway ).
I am still trying to grasp the 'purpose' of classmethods.
Michele Simiona
> M.E.Farmer:
>Your answer lies somewhere in this page ;)
>http://www.python.org/2.2.2/descrintro.html
Yes, when it refers to
http://www.python.org/2.3/mro.html
(section Bad Method Resolution Orders).
In short, it is a feature, not a bug.
Michele Simionato
--
http://mai
M.E.Farmer:
> Your answer lies somewhere in this page ;)
> http://www.python.org/2.2.2/descrintro.html
> M.E.Farmer
delegate.py (use PyPI) may also be useful.
-Robert Dick-
--
http://mail.python.org/mailman/listinfo/python-list
Your answer lies somewhere in this page ;)
http://www.python.org/2.2.2/descrintro.html
M.E.Farmer
--
http://mail.python.org/mailman/listinfo/python-list
Trying to create the "lopsided diamond" inheritance below:
>>> class B(object):pass
>>> class D1(B):pass
>>> class D2(D1):pass
>>> class D(D1, D2):pass
Traceback (most recent call last):
File "", line 1, in ?
TypeError: Error when calling the metaclass bases
Cannot create a consistent method
15 matches
Mail list logo