Re: [sage-devel] Re: Cached method and inheritance

2011-05-28 Thread Florent Hivert
Hi Simon, > On 28 Mai, 18:12, Florent Hivert wrote: > > Just to let you know, I tried the following work around: > > > > ... > > but since A.toto.f.__name__ is still toto. It doesn't work. However the > > following works (on unpatched sage-4.6.2): > > > > def change_name(fun, name): > >    

[sage-devel] Re: Cached method and inheritance

2011-05-28 Thread Simon King
Hi Florent, On 28 Mai, 18:12, Florent Hivert wrote: > Just to let you know, I tried the following work around: > > ... > but since A.toto.f.__name__ is still toto. It doesn't work. However the > following works (on unpatched sage-4.6.2): > > def change_name(fun, name): >     fun = copy(fun) >    

[sage-devel] Re: Cached method and inheritance

2011-05-28 Thread Simon King
Hi Florent, On 27 Mai, 23:16, Florent Hivert wrote: > Using the C class thing are even more weird: > > sage: c = C() > sage: c.toto() > [...] > TypeError: toto() takes exactly 2 arguments (3 given) I think I understand what happens in that case: Inside c.toto(...), there is the line A.toto(self

Re: [sage-devel] Re: Cached method and inheritance

2011-05-28 Thread Florent Hivert
Hi Simon, > > But my patches do not solve the problem either -- only the error > > message for b is different: > > sage: b = B() > > sage: b.toto() > > 3 > > sage: b.toto() > > Traceback (most recent call last): > > ... > > TypeError: toto() takes exactly 2 arguments (1 given) > > > > I can

Re: [sage-devel] Re: Cached method and inheritance

2011-05-28 Thread Florent Hivert
Hi Simon, > just for clarification: What you are reporting is the behaviour or > unpatched Sage, i.e., it is not caused by my patches from #5, > correct? Sorry, for my unprecise bug report. I indeed had the problem with unpatched sage 4.6.2. > But my patches do not solve the problem ei

[sage-devel] Re: Cached method and inheritance

2011-05-28 Thread Simon King
Hi Florent, just for clarification: What you are reporting is the behaviour or unpatched Sage, i.e., it is not caused by my patches from #5, correct? But my patches do not solve the problem either -- only the error message for b is different: sage: b = B() sage: b.toto() 3 sage: b.toto() Trac