Hi again,

here is a minimal example of the problem that has nothing to do with
my original classes, apparently a cached_method in a base category
cannot be called from a method in the derived category:

sage: class A:
....:     @cached_method
....:     def foo(self):
....:         print("A.foo")
....:
sage: class B(A):
....:     def Afoo(self):
....:         A.foo(self)
....:
sage: E = B()
sage: E.foo()
B.foo
sage: E.Afoo()
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (396, 0))

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)

/Users/javier/<ipython console> in <module>()

/Users/javier/<ipython console> in Afoo(self)

/Applications/sage/local/lib/python2.6/site-packages/sage/misc/
cachefunc.pyc in __call__(self, *args, **kwds)
    553             return self.cache[k]
    554         except KeyError:
--> 555             w =
self._cachedmethod._instance_call(self._instance, *args, **kwds)
    556             self.cache[k] = w
    557             return w

/Applications/sage/local/lib/python2.6/site-packages/sage/misc/
cachefunc.pyc in _instance_call(self, inst, *args, **kwds)
    776
    777         """
--> 778         return self._cachedfunc.f(inst, *args, **kwds)
    779
    780     def _get_instance_cache(self, inst):

TypeError: foo() takes exactly 1 argument (2 given)


Is this a bug or a feature?

Cheers,
Javier

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to