(cls, ai, bj)
return self
For convenience if reduction is not possible, return None.
For convenience if reduction is not possible, return None.
For convenience if reduction is not possible return None .
def __new__(cls, ai, bj):
        """ For convenience if reduction is not possible, return None. """
        ai = sympify(ai)
        bj = sympify(bj)
        n = ai - bj
        if not n.is_Integer or n < 0:
            return None
        if bj.is_integer and bj <= 0 and bj + n - 1 >= 0:
            return None

        self = Operator.__new__(cls)

        p = S(1)
        for k in xrange(n):
            p *= (_x + bj + k)/(bj + k)

        self._poly = Poly(p, _x)
        self._a = ai
        self._b = bj

        return self
def __new__ ( cls , ai , bj ) : ai = sympify ( ai ) bj = sympify ( bj ) n = ai - bj if not n . is_Integer or n < 0 : return None if bj . is_integer and bj <= 0 and bj + n - 1 >= 0 : return None self = Operator . __new__ ( cls ) p = S ( 1 ) for k in xrange ( n ) : p *= ( _x + bj + k ) / ( bj + k ) self . _poly = Poly ( p , _x ) self . _a = ai self . _b = bj return self