Reputation: 2030
With the following code snippet in PyCharm:
print(1.0 < 2.0 < 3.0)
I received the following warning over the 3.0
:
Expected type
int
, gotfloat
instead.
Why the expected type given by PyCharm is int
? Is that a typing error from PyCharm or is it something fundamental about the chain comparison?
The following code do not raise any PyCharm warning:
print(1.0 < 2.0 < 3)
print(1.0 < 2 < 3)
Upvotes: 2
Views: 79
Reputation: 2030
I found the issue in the PyCharm bug tracker thanks to @AKX. It should be fix by now, I'll update my PyCharm version to 2018.
Follow-up: It's fixed in 2018.
Upvotes: 3