Cython classes by default don't have a __dict__ (which is why you're
seeing the error below).  Maybe the deprecated_function_alias should
be modified to allow for deprecated aliases in cython classes.
David

On Sun, Dec 19, 2010 at 16:42, Rob Beezer <goo...@beezer.cotse.net> wrote:
> I'm trying to use deprecated_function_alias() from sage/misc/misc.py
> in a *.pyx file, specifically, matrix2.pyx.
>
> Should this be possible?  I don't see anywhere in the source where
> this is used in a *.pyx file.
>
> Sage rebuilds fine, but complains on startup while importing.  Tail of
> the errors reported follows below.  Maybe I just need to do the
> deprecation the old-fashioned way, but I'd prefer to use the
> standardized function designed for this purpose.
>
> Rob
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> (Line 46674 of the C file corresponds to the following (new) line in
> matrix2.pyx:
>     adjoint = deprecated_function_alias(adjugate, 'Sage Version
> 4.6.2')
> )
>
> /sage/dev/local/bin/matrix2.pyx in init sage.matrix.matrix2 (sage/
> matrix/matrix2.c:46674)()
>
> /sage/dev/local/lib/python2.6/site-packages/sage/misc/misc.pyc in
> deprecated_function_alias(func, version)
>   2103      - Florent Hivert (2009-11-23), with the help of Mike
> Hansen.
>   2104     """
> -> 2105     return DeprecatedFunctionAlias(func, version)
>   2106
>   2107 def deprecated_callable_import(module_name, globs, locs,
> fromlist, message=None):
>
> /sage/dev/local/lib/python2.6/site-packages/sage/misc/misc.pyc in
> __init__(self, func, version)
>   2003         """
>   2004         self.__doc__ = func.__doc__
> -> 2005         self.__dict__.update(func.__dict__)
>   2006         self.func = func
>   2007         self.version  = version
>
> AttributeError: 'method_descriptor' object has no attribute '__dict__'
>
> --
> 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
>

-- 
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