Re: proxy class and __add__ method

2008-07-30 Thread Gabriel Genellina
En Wed, 30 Jul 2008 14:54:51 -0300, Rhamphoryncus <[EMAIL PROTECTED]> escribió: On Jul 29, 10:23 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: En Tue, 29 Jul 2008 13:13:51 -0300, Magnus Schuster   <[EMAIL PROTECTED]> escribi : > I have written the following small proxy class which I exp

Re: proxy class and __add__ method

2008-07-30 Thread Gabriel Genellina
En Wed, 30 Jul 2008 07:48:45 -0300, Magnus Schuster <[EMAIL PROTECTED]> escribi�: __magic__ methods on new style classes are searched in the class, *not* in the instance. prx_i+1 looks for __add__ in type(prx_i), that is, in the proxy class. With this explanation the behaviour is absolutel

Re: proxy class and __add__ method

2008-07-30 Thread Rhamphoryncus
On Jul 29, 10:23 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 29 Jul 2008 13:13:51 -0300, Magnus Schuster   > <[EMAIL PROTECTED]> escribi : > > > > > Hello, > > I have written the following small proxy class which I expect to pass all > > function calls to the 'original' object: > >

Re: proxy class and __add__ method

2008-07-30 Thread Magnus Schuster
self.__subject, name ) prx_i=proxy(1) k=prx_i+1 --- END --- The error is the same as before. Please note that I want to avoid reimplementing all methods of 'int', because the proxy class should be universal. (The meta.__add__ method is for testing only). -- View this messag

Re: proxy class and __add__ method

2008-07-29 Thread Gabriel Genellina
En Tue, 29 Jul 2008 13:13:51 -0300, Magnus Schuster <[EMAIL PROTECTED]> escribi�: Hello, I have written the following small proxy class which I expect to pass all function calls to the 'original' object: --- BEGIN --- class proxy(object): def __init__( self, subject ): self.__subj

proxy class and __add__ method

2008-07-29 Thread Magnus Schuster
: unsupported operand type(s) for +: 'proxy' and 'int'. How is this addition different from the previous line "j=..."? And how can I modify the proxy class so that all methods are passed on, which are not explicitly overloaded? Regards, Magnus -- View this message