Larry: Using "as", I cannot use both Circle and ColorCircle or more
like 3DCircle ... at the same time, only one of them.
But this is a easy solution in some cases.
On 31 mai, 00:25, Matimus <[EMAIL PROTECTED]> wrote:
Hi Martimus, your idea was a good one, I used it to meet my
_particular_ need
This is a rather simplistic example, but you may be able to use a
mixin class to achieve what you need. The idea is that you write a
class that overrides only what is needed to add the new functionality.
For you it would be Color.
[code]
class Graph(object):
def _foo(self):
print "Grap
aspineux wrote:
> Hi
>
> I would like a kind of function able to replace the base class like
> that:
>
> class Graph:
> pass
>
> class Circle(Graph):
> pass
>
> class Square(Graph):
> pass
>
> class ColorGraph:
> pass
>
>
Hi
I would like a kind of function able to replace the base class like
that:
class Graph:
pass
class Circle(Graph):
pass
class Square(Graph):
pass
class ColorGraph:
pass
def Adopt(new_base_class, child_class, old_base_class):
return newclass
ColorCircle=Adopt