#12070: Unavoidable DeprecationWarnings when calling piecewise functions
-------------------------+--------------------------------------------------
   Reporter:  mjo        |          Owner:  burcin  
       Type:  defect     |         Status:  new     
   Priority:  minor      |      Milestone:  sage-4.8
  Component:  symbolics  |       Keywords:          
Work_issues:             |       Upstream:  N/A     
   Reviewer:             |         Author:          
     Merged:             |   Dependencies:          
-------------------------+--------------------------------------------------
 When using piecewise functions across modules, you can find yourself
 unable to avoid the DeprecationWarning resulting from positional
 arguments, e.g. f(0).

 A small example:

 some_library.py
 {{{
 from sage.all import *

 def make_f():
     x = SR.symbol('x', domain='real')
     f = piecewise([[(-1,1), x**2]])
     return f
 }}}

 some_script.py
 {{{
 from some_library import *

 my_f = make_f()
 my_f(0)
 }}}

 There is no obvious (or un-obvious, as far as I know) way to avoid the
 warning here.

 The output, for reference:

 {{{
 $ sage some_script.py
 some_script.py:4: DeprecationWarning: Substitution using function-call
 syntax and unnamed arguments is deprecated and will be removed from a
 future release of Sage; you can use named arguments instead, like
 EXPR(x=..., y=...)
   my_f(0)
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12070>
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