Opened 10 years ago

Last modified 6 years ago

#9126 needs_work defect

Symbolic arguments() method

Reported by: jason Owned by: burcin
Priority: major Milestone: sage-6.4
Component: symbolics Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

Right now, the following works:

sage: a=(x+y)
sage: a.arguments()
(x, y)

However, we deprecated the following a long time ago:

sage: a(1,2)
/Users/grout/sage/local/lib/python2.6/site-packages/IPython/iplib.py:2073:
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=...)
   exec code_obj in self.user_global_ns, self.user_ns
3

I propose that a.arguments() should return a deprecation warning:

sage: a.arguments()
/Users/grout/sage/local/lib/python2.6/site-packages/IPython/iplib.py:2073:
DeprecationWarning: (Since Sage version 4.4.2) symbolic expressions do
not have default callable arguments.  Please use the variables() method
   exec code_obj in self.user_global_ns, self.user_ns
(x, y)

This will impact other things as well, since apparently things have been using .arguments() when they should have been using .variables(). I can post a patch for this. Here, I'm just calling for comment, especially from those that think this will mess everything up in some way.

Note that callable functions will still have sensible return values:

sage: f(x,y)=x+y
sage: f.arguments()
(x, y) 

Attachments (1)

trac-9126-arguments.patch (5.9 KB) - added by jason 10 years ago.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by jason

comment:1 Changed 10 years ago by jason

  • Status changed from new to needs_work

I've attached a rough patch which needs work to finish fixing the ramifications of this change.

comment:2 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:3 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:4 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:5 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.