Lines 320 to 325 of numpy/polynomial/_polybase.py contains the following code:
# filter out uninteresting coefficients
filtered_coeffs = [
(i, c)
for i, c in enumerate(self.coef)
# if not (c == 0) # handle NaN
]
A few things to note:
- the comment no longer describes what the comprehension does
- the conditional is commented out
- resulting list is never used
Looks like this is just some leftover code from a prior implementation that has caused no problems, as so has been overlooked.