Skip to content

Commit

Permalink
Replace hasattr(... '__iter__') by check with is_sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
theHamsta committed Dec 9, 2020
1 parent 425353e commit b1782d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sympy/polys/polyoptions.py
Expand Up @@ -10,6 +10,7 @@
from sympy.polys.polyerrors import GeneratorsError, OptionError, FlagError
from sympy.utilities import numbered_symbols, topological_sort, public
from sympy.utilities.iterables import has_dups
from sympy.core.compatibility import is_sequence

import sympy.polys

Expand Down Expand Up @@ -283,7 +284,7 @@ def default(cls):
def preprocess(cls, gens):
if isinstance(gens, Basic):
gens = (gens,)
elif len(gens) == 1 and hasattr(gens[0], '__iter__'):
elif len(gens) == 1 and is_sequence(gens[0]):
gens = gens[0]

if gens == (None,):
Expand Down

0 comments on commit b1782d6

Please sign in to comment.