summaryrefslogtreecommitdiff
path: root/numpy/polynomial/_polybase.py
diff options
context:
space:
mode:
authorRoss Barnowski <rossbar@berkeley.edu>2020-05-13 16:16:04 -0700
committerRoss Barnowski <rossbar@berkeley.edu>2020-05-13 16:16:04 -0700
commit8922a6e025d53d5aaccba02b76dbef5a43afe768 (patch)
treeb14bc769c1339e4e43570d3ecef29072f45b30cf /numpy/polynomial/_polybase.py
parent66365a57ff9b68a191fd232dc823cc2cf69d267f (diff)
downloadnumpy-8922a6e025d53d5aaccba02b76dbef5a43afe768.tar.gz
STY: Move comment outside of try/except.
Diffstat (limited to 'numpy/polynomial/_polybase.py')
-rw-r--r--numpy/polynomial/_polybase.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/polynomial/_polybase.py b/numpy/polynomial/_polybase.py
index 7616b95c7..30887b670 100644
--- a/numpy/polynomial/_polybase.py
+++ b/numpy/polynomial/_polybase.py
@@ -347,14 +347,14 @@ class ABCPolyBase(abc.ABC):
out += " "
power = str(i + 1)
# Polynomial coefficient
+ # The coefficient array can be an object array with elements that
+ # will raise a TypeError with >= 0 (e.g. strings or Python
+ # complex). In this case, represent the coeficient as-is.
try:
if coef >= 0:
next_term = f"+ {coef}"
else:
next_term = f"- {-coef}"
- # The coefficient array can be an object array with elements that
- # will raise a TypeError with >= 0 (e.g. strings or Python
- # complex). In this case, represent the coeficient as-is.
except TypeError:
next_term = f"+ {coef}"
# Polynomial term