#13586: BuiltinFunction expects to be instantiated only once
-------------------------+--------------------------------------------------
   Reporter:  burcin     |             Owner:  burcin           
       Type:  defect     |            Status:  new              
   Priority:  major      |         Milestone:  sage-5.5         
  Component:  symbolics  |          Keywords:  symbolic function
Work issues:             |   Report Upstream:  N/A              
  Reviewers:             |           Authors:  Burcin Erocal    
  Merged in:             |      Dependencies:                   
   Stopgaps:             |  
-------------------------+--------------------------------------------------
 From [[http://ask.sagemath.org/question/1843/weird-behavior-
 builtinfunction|this ask.sagemath.org question]]:

 {{{
 sage: from sage.symbolic.function import BuiltinFunction
 sage: class AFunction(BuiltinFunction):
 ....:         def __init__(self, name, exp=1):
 ....:             self.exponent=exp
 ....:         BuiltinFunction.__init__(self, name, nargs=1)
 ....:     def _eval_(self, arg):
 ....:             return arg**self.exponent
 ....:
 sage: p2 = AFunction('p2', 2)
 sage: p2(x)
 x^2
 sage: p3 = AFunction('p3', 3)
 sage: p3(x)
 x^2
 }}}

 ATM, we only allow a `BuiltinFunction` to be instantiated once.

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