#11585: Make deprecated_function_alias print the whole module path when it 
differs
from the original
---------------------------+------------------------------------------------
   Reporter:  defeo        |          Owner:  jason          
       Type:  enhancement  |         Status:  positive_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:                 
---------------------------+------------------------------------------------

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

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

 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.


 '''Apply:'''
   1.  [attachment:trac_11585_deprecated_function_alias.patch]

--

Comment(by hivert):

 I've no particular comments concerning this patch. We should start to
 actually remove deprecated things from sage, but this is another problem.
 Ready to go.

 Florent

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11585#comment:5>
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.

Reply via email to