#11585: Make deprecated_function_alias print the whole module path when it
differs
from the original
---------------------------+------------------------------------------------
Reporter: defeo | Owner: jason
Type: enhancement | Status: needs_review
Priority: minor | Milestone: sage-4.7.2
Component: misc | Keywords: deprecation
Work_issues: | Upstream: N/A
Reviewer: Rob Beezer | Author: Luca De Feo
Merged: | Dependencies:
---------------------------+------------------------------------------------
Changes (by defeo):
* status: needs_work => needs_review
Old description:
> Currently
>
> {{{
> sage: from sage.misc.misc import deprecated_function_alias
> sage: a = deprecated_function_alias(sqrt, "Version ?")
> sage: a(5)
> ...
> DeprecationWarning: (Since Version ?) a is deprecated. Please use sqrt
> instead.
> sqrt(5)
> }}}
>
> '''Apply:'''
> 1. [attachment:trac_11585_depracted_function_alias.patch]
>
> which is misleading because the user would expect to find `sqrt` in the
> same module as `a`.
>
> With this patch
>
> {{{
> sage: from sage.misc.misc import deprecated_function_alias
> sage: a = deprecated_function_alias(sqrt, "Version ?")
> sage: a(5)
> ...
> DeprecationWarning: (Since Version ?) a is deprecated. Please use
> sage.functions.other.sqrt instead.
> sqrt(5)
> }}}
>
> There's no change in deprecating methods.
New description:
Currently
{{{
sage: from sage.misc.misc import deprecated_function_alias
sage: a = deprecated_function_alias(sqrt, "Version ?")
sage: a(5)
...
DeprecationWarning: (Since Version ?) a is deprecated. Please use sqrt
instead.
sqrt(5)
}}}
'''Apply:'''
1. [attachment:trac_11585_deprecated_function_alias.patch]
which is misleading because the user would expect to find `sqrt` in the
same module as `a`.
With this patch
{{{
sage: from sage.misc.misc import deprecated_function_alias
sage: a = deprecated_function_alias(sqrt, "Version ?")
sage: a(5)
...
DeprecationWarning: (Since Version ?) a is deprecated. Please use
sage.functions.other.sqrt instead.
sqrt(5)
}}}
There's no change in deprecating methods.
--
Comment:
Modified as requested by rbeezer. Apply second patch only (sorry for the
mispelling in the first patch).
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11585#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.