I think the problem is in CachedMethodCallerNoArgs.__get__, which is the function responsible for retrieving the cached function instance from the class or its instance. See line 1807 for sage/misc/ cachefunc.pyx:
try: return (<dict>inst.__cached_methods).__getitem__(self.__name__) except (AttributeError,TypeError,KeyError),msg: pass Caller = CachedMethodCallerNoArgs(inst, self.f, name=self.__name__) try: setattr(inst,self.__name__, Caller) return Caller It goes through this trouble because the first time this attribute it accessed, the instance found is the one bound to the class attribute (i.e., the first return fails). The code then creates a new CachedMethodCallerNoArgs instance, but now with reference to the actual instance. This is a fresh instance with an empty cache. The next time around, this shouldn't happen anymore! indeed, "setattr(inst,self.__name__, Caller)" seems to try and fix that. But that won't make "return (<dict>inst.__cached_methods).__getitem__(self.__name__)" succeed next time around! shouldn't it also try "return (<dict>inst.__dict__).__getitem__(self.__name__)" to match the "setattr" attempt? Anyway, this code looks like it should be sensitive to aliases. It's certainly code that's quite different from CachedMethodCaller.__get__ -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel?hl=en. For more options, visit https://groups.google.com/groups/opt_out.