Thanks Simon. Actually, this was the first thing that I tried: SemistandardTableaux_nmu=deprecated_function_alias(9265,SemistandardTableaux_size_evaluation)
but it leads to the error: sage: sage.combinat.tableau.SemistandardTableaux_nmu(4,[2,1]) 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', (69, 0)) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /usr/local/src/sage/sage-5.3.beta0/devel/sage-combinat/sage/combinat/<ipython console> in <module>() /usr/local/src/sage/sage-5.3.beta0/local/lib/python2.7/site-packages/sage/misc/superseded.pyc in __call__(self, *args, **kwds) 196 197 deprecation(self.trac_number, --> 198 "%s is deprecated. Please use %s instead."%(self.__name__, other)) 199 if self.instance is None: 200 return self.func(*args, **kwds) /usr/local/src/sage/sage-5.3.beta0/local/lib/python2.7/site-packages/sage/misc/lazy_attribute.pyc in __get__(self, a, cls) 533 except KeyError: 534 pass --> 535 result = self.f(a) 536 if result is NotImplemented: 537 # Workaround: we make sure that cls is the class /usr/local/src/sage/sage-5.3.beta0/local/lib/python2.7/site-packages/sage/misc/superseded.pyc in __name__(self) 176 if val is self: 177 return key --> 178 raise AttributeError, "The name of this deprecated function can not be determined" 179 180 def __call__(self, *args, **kwds): AttributeError: The name of this deprecated function can not be determined This is a little strange a both the deprecated function alias and the new class have __name__ attributes... Andrew On Thursday, 16 August 2012 01:51:43 UTC+10, Simon King wrote: > > Hi Andrew, > > On 2012-08-15, Andrew Mathas <andrew...@gmail.com <javascript:>> wrote: > > I tried: > > > > sage: old_class = deprecated_function_alias(123456,new_class.__init__) > > > > and some variations on this but they all gave the error > > Classes are callable, and apparently one wants to deprecate the callable. > Hence, the following seems to work: > > sage: from sage.misc.superseded import deprecated_function_alias > sage: class A: pass > ....: > sage: B = deprecated_function_alias(12345, A) > sage: B() > /home/simon/SAGE/prerelease/sage-5.2.rc0/local/bin/sage-ipython:1: > DeprecationWarning: B is deprecated. Please use A instead. > See http://trac.sagemath.org/12345 for details. > #!/usr/bin/env python > <__main__.A instance at 0x449d098> > > Cheers, > Simon > > -- -- 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