From 4f2006f08f921b00c19d02761ef50845082b6d2b Mon Sep 17 00:00:00 2001 From: ashishkg0022 Date: Fri, 3 Nov 2017 14:02:49 +0530 Subject: [PATCH 1/3] added property is_number --- sympy/functions/special/hyper.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sympy/functions/special/hyper.py b/sympy/functions/special/hyper.py index 05dd3ec32606..fff0a1b988ca 100644 --- a/sympy/functions/special/hyper.py +++ b/sympy/functions/special/hyper.py @@ -704,6 +704,12 @@ def delta(self): c.f. references. """ return len(self.bm) + len(self.an) - S(len(self.ap) + len(self.bq))/2 + @property + def is_number(self): + """ Returns true if expression has numeric data only. """ + from sympy import Symbol + return not self.atoms(Symbol) + class HyperRep(Function): """ From 55446f71595940670be1cd3b1f142cde7c29c1b9 Mon Sep 17 00:00:00 2001 From: ashishkg0022 Date: Fri, 3 Nov 2017 14:03:43 +0530 Subject: [PATCH 2/3] added tests for is_number property --- sympy/functions/special/tests/test_hyper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sympy/functions/special/tests/test_hyper.py b/sympy/functions/special/tests/test_hyper.py index bb9290d3a329..11e5b90b8786 100644 --- a/sympy/functions/special/tests/test_hyper.py +++ b/sympy/functions/special/tests/test_hyper.py @@ -123,6 +123,9 @@ def test_meijer(): assert g.nu == 75 assert g.delta == -1 assert g.is_commutative is True + assert g.is_number is False + #issue 13071 + assert meijerg([[],[]], [[S(1)/2],[0]], 1).is_number is True assert meijerg([1, 2], [3], [4], [5], z).delta == S(1)/2 From f62afe1dc2db3904abeb3afa73d82fa06c5dd5bb Mon Sep 17 00:00:00 2001 From: ashishkg0022 Date: Sat, 4 Nov 2017 00:58:56 +0530 Subject: [PATCH 3/3] modified to ignore bound symbols --- sympy/functions/special/hyper.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sympy/functions/special/hyper.py b/sympy/functions/special/hyper.py index fff0a1b988ca..3cb31fe5176c 100644 --- a/sympy/functions/special/hyper.py +++ b/sympy/functions/special/hyper.py @@ -707,8 +707,7 @@ def delta(self): @property def is_number(self): """ Returns true if expression has numeric data only. """ - from sympy import Symbol - return not self.atoms(Symbol) + return not self.free_symbols class HyperRep(Function):