Ticket #2933 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

[with patch, with positive review] calculus -- substitution of a dict for SymbolicFunctionEvaluation is broken (but **kwds works)

Reported by: was Owned by: mhansen
Priority: major Milestone: sage-3.0
Component: calculus Keywords:
Cc: Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

Substitution with a dictionary as input is broken. Notice below in the third input that the dictionary is ignored?!

sage: function('f',x)
f(x)
sage: (f(x)).substitute(f=log)
log(x)
sage: (f(x)).substitute({f:log})
f(x)
sage: type(f(x))
<class 'sage.calculus.calculus.SymbolicFunctionEvaluation'>
sage: (x^3 + 1).substitute(x=5)
126
sage: (x^3 + 1).substitute({x:5})
126

Attachments

2933.patch Download (2.3 KB) - added by mhansen 5 years ago.

Change History

Changed 5 years ago by mhansen

comment:1 Changed 5 years ago by mhansen

  • Owner changed from was to mhansen
  • Status changed from new to assigned
  • Summary changed from calculus -- substitution of a dict for SymbolicFunctionEvaluation is broken (but **kwds works) to [with patch, needs review] calculus -- substitution of a dict for SymbolicFunctionEvaluation is broken (but **kwds works)

comment:2 Changed 5 years ago by ncalexan

  • Summary changed from [with patch, needs review] calculus -- substitution of a dict for SymbolicFunctionEvaluation is broken (but **kwds works) to [with patch, with positive review] calculus -- substitution of a dict for SymbolicFunctionEvaluation is broken (but **kwds works)

I find the business with isinstance(str) strange, but it looks right and the doctests assert the correct behaviour.

comment:3 Changed 5 years ago by mabshoff

  • Status changed from assigned to closed
  • Resolution set to fixed

Merged in Sage 3.0.alpha6

Note: See TracTickets for help on using tickets.