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__', 'spin'] In f.x.

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): ... def spin(self, k):

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() dir(myC) ['__doc__',

Re: reaching hidden methods + casting

2007-04-12 Thread per9000
On 12 Apr, 09:42, Gabriel Genellina [EMAIL PROTECTED] wrote: snip 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) snip Thanks, that was exactly the insight