#11585: Make deprecated_function_alias print the whole module path when it 
differs
from the original
--------------------------------------------+-------------------------------
    Reporter:  defeo                        |         Owner:              
        Type:  enhancement                  |        Status:  needs_review
    Priority:  minor                        |     Milestone:  sage-5.0    
   Component:  misc                         |    Resolution:              
    Keywords:  deprecation                  |   Work_issues:  startuptime 
    Upstream:  N/A                          |      Reviewer:  Rob Beezer  
      Author:  Luca De Feo, Florent Hivert  |        Merged:              
Dependencies:                               |  
--------------------------------------------+-------------------------------
Changes (by hivert):

  * 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)
> }}}
>
> 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+rc1.patch]

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-rc2.patch]

--

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