(self)
return not isyms
Return True if the Integral will result in a number, else False.

        Integrals are a special case since they contain symbols that can
        be replaced with numbers. Whether the integral can be done or not is
        another issue. But answering whether the final result is a number is
        not difficult.

        Examples
        ========

        >>> from sympy import Integral
        >>> from sympy.abc import x, y
        >>> Integral(x).is_number
        False
        >>> Integral(x, y).is_number
        False
        >>> Integral(x, (y, 1, x)).is_number
        False
        >>> Integral(x, (y, 1, 2)).is_number
        False
        >>> Integral(x, (y, 1, 1)).is_number
        True
        >>> Integral(x, (x, 1, 2)).is_number
        True
        >>> Integral(x*y, (x, 1, 2), (y, 1, 3)).is_number
        True
        >>> Integral(1, x, (x, 1, 2)).is_number
        True

        Notes
        =====

        There are two non-heroic tests that are made here to recognize
        situations where a free symbol is not actually free: when the upper
        and lower limits are the same and when an integration variable is
        not in the free symbols (in which case only free symbols of the
        difference in limits are potential free symbols). The tests are of
        the most trivial nature, however, and it should always be true that if
        this routine returns True that evalf should be able to evaluate the
        expression.

        See Also
        ========

        is_zero
Return True if the Integral will result in a number, else False.
Return True if the Integral will result in a number else False .
def is_number(self):
        """
        Return True if the Integral will result in a number, else False.

        Integrals are a special case since they contain symbols that can
        be replaced with numbers. Whether the integral can be done or not is
        another issue. But answering whether the final result is a number is
        not difficult.

        Examples
        ========

        >>> from sympy import Integral
        >>> from sympy.abc import x, y
        >>> Integral(x).is_number
        False
        >>> Integral(x, y).is_number
        False
        >>> Integral(x, (y, 1, x)).is_number
        False
        >>> Integral(x, (y, 1, 2)).is_number
        False
        >>> Integral(x, (y, 1, 1)).is_number
        True
        >>> Integral(x, (x, 1, 2)).is_number
        True
        >>> Integral(x*y, (x, 1, 2), (y, 1, 3)).is_number
        True
        >>> Integral(1, x, (x, 1, 2)).is_number
        True

        Notes
        =====

        There are two non-heroic tests that are made here to recognize
        situations where a free symbol is not actually free: when the upper
        and lower limits are the same and when an integration variable is
        not in the free symbols (in which case only free symbols of the
        difference in limits are potential free symbols). The tests are of
        the most trivial nature, however, and it should always be true that if
        this routine returns True that evalf should be able to evaluate the
        expression.

        See Also
        ========

        is_zero
        """

        integrand, limits = self.function, self.limits
        isyms = integrand.free_symbols
        for xab in limits:
            if len(xab) == 1:
                isyms.add(xab[0])
                continue  # it may be removed later

            if len(xab) == 3 and xab[1] == xab[2]:
                # this is a non-heroic test and evalf knows about it
                return True

            if xab[0] in isyms:
                # take it out of the symbols since it will be replaced
                # with the free symbols in the limits
                isyms.remove(xab[0])
            elif len(xab) == 3:
                # the integration variable isn't in the free symbols so
                # integration will introduce a linear factor and any
                # expression in the lower and upper limit that doesn't
                # appear in the difference of those limits will cancel
                # and thus NOT add to the free symbols, e.g.
                # Integral(x, (y, d, d + 1)) == Integral(x, (y, 0, 1)).
                # This is a non-heroic test and evalf knows about it
                isyms.update((xab[2] - xab[1]).free_symbols)
                continue

            # add in the new symbols
            for i in xab[1:]:
                isyms.update(i.free_symbols)

        # if there are no surviving symbols then the result is a number
        return not isyms
def is_number ( self ) : integrand , limits = self . function , self . limits isyms = integrand . free_symbols for xab in limits : if len ( xab ) == 1 : isyms . add ( xab [ 0 ] ) continue # it may be removed later if len ( xab ) == 3 and xab [ 1 ] == xab [ 2 ] : # this is a non-heroic test and evalf knows about it return True if xab [ 0 ] in isyms : # take it out of the symbols since it will be replaced # with the free symbols in the limits isyms . remove ( xab [ 0 ] ) elif len ( xab ) == 3 : # the integration variable isn't in the free symbols so # integration will introduce a linear factor and any # expression in the lower and upper limit that doesn't # appear in the difference of those limits will cancel # and thus NOT add to the free symbols, e.g. # Integral(x, (y, d, d + 1)) == Integral(x, (y, 0, 1)). # This is a non-heroic test and evalf knows about it isyms . update ( ( xab [ 2 ] - xab [ 1 ] ) . free_symbols ) continue # add in the new symbols for i in xab [ 1 : ] : isyms . update ( i . free_symbols ) # if there are no surviving symbols then the result is a number return not isyms