reaching hidden methods + casting

2007-04-12 Thread per9000
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__'

Re: reaching hidden methods + casting

2007-04-12 Thread Gabriel Genellina
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): > ..

Re: reaching hidden methods + casting

2007-04-12 Thread Bruno Desthuilliers
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

Re: reaching hidden methods + casting

2007-04-12 Thread per9000
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