Hi Andrew,

On 2012-08-15, Andrew Mathas <andrew.mat...@gmail.com> 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



Reply via email to