Reputation: 3848
PyCharm is showing this warning and I cannot figure out why.
def record(self, *data: Sequence[Union[int, float, str]]) -> None:
for field, value in zip(self.fields, data):
if field.type in {1, 3}:
try:
value = int(value) # warning is here
except ValueError:
pass
# other logic...
Its saying that value
from the unpacked zip
is the same type as the argument data
, but its not nor should it be. If it was an element of a Sequence
that would mean it would be a Union[int, float, str]
type.
Does PyCharm not realize that zip
was unpacked?
Upvotes: 1
Views: 1083