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


Ignore:
Timestamp:
12/05/13 08:50:43 (7 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9706, comment 72

    v1 v2  
    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.
    2 
    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(OrthogonalPolynomial,self)` but `super(BuiltinFunction, self)`.
    42
    53So, I would do something like
     
    75def __call__(self,n,x):
    86    if is_Expression(n):
    9         return super(BuiltinFunction, self).__call__(n,x)
     7        return super(OrthogonalPolynomial, self).__call__(n,x)
    108    # We consider the polynomial really as a polynomial,
    119    # not a symbolic expression.