On 12 Apr, 09:42, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
>
>
>
> > In f.x. the C-family of languages I guess something like this would
> > call B.spin:
> > ((B)myC).spin("Lancelot"); // almost forgot the ';'
>
> Try this in Python:
> B.spin(myC, "Lancelot")
>
>
>
>
Thanks, that was exac
per9000 a écrit :
> Hi,
> can I reach a hidden method when doing ugly inheritance in python?
>
class A:
> ... def spin(self, n): print "A", n
> ...
class B:
> ... def spin(self, m): print "B", m
> ...
class C(A,B):
> ... def spin(self, k): print "C", k
> ...
myC = C
En Thu, 12 Apr 2007 04:18:19 -0300, per9000 <[EMAIL PROTECTED]> escribió:
> Hi,
> can I reach a hidden method when doing ugly inheritance in python?
>
class A:
> ... def spin(self, n): print "A", n
> ...
class B:
> ... def spin(self, m): print "B", m
> ...
class C(A,B):
> ..
Hi,
can I reach a hidden method when doing ugly inheritance in python?
>>> class A:
... def spin(self, n): print "A", n
...
>>> class B:
... def spin(self, m): print "B", m
...
>>> class C(A,B):
... def spin(self, k): print "C", k
...
>>> myC = C()
>>> dir(myC)
['__doc__', '__module__'