Changes between Initial Version and Version 1 of Ticket #9706, comment 72


Ignore:
Timestamp:
12/05/13 08:46:37 (8 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9706, comment 72

    initial v1  
    11I think that `chebyshev_T(1/2, 2)` should raise a `ValueError` (or can we make sense of this?). So, in your code there should really be 3 cases: integer, symbolic and "something else" which is always an error.
    22
    3 Also: the code block you wrote above is a good example of something would could fit in the generic `SymbolicPolynomial` (or `OrthogonalPolynomial` if you like) class. So I wouldn't use `super` but simply a different method like `_eval_symbolic()`.
     3Also: the code block you wrote above is a good example of something would could fit in the generic `SymbolicPolynomial` (or `OrthogonalPolynomial` if you like) class. So I wouldn't use `super(OrthogonalPolynomial,self)` but `super(BuiltinFunction, self)`.
    44
    55So, I would do something like
     
    77def __call__(self,n,x):
    88    if is_Expression(n):
    9         return self._eval_symbolic(n, x)
     9        return super(BuiltinFunction, self).__call__(n,x)
    1010    # We consider the polynomial really as a polynomial,
    1111    # not a symbolic expression.