pylint #3216 E1101 false positive with numarray.randint [resolved]
Daniel Drake reported:
import numarray as na import numarray.random_array as nar im16 = nar.randint(0, 256, 300).astype(na.UInt8)
The above program causes pylint to complain:
E1101: 3: Instance of 'int' has no 'astype' member
This is with numarray-1.5.2. The randint function returns either a numarray or an int. In this context it will only return a numarray so .astype() is valid.
Syt: hard to fix... A possible solution might be to: * issue E1101 when the searched member is not found on every infered value * issue another warning when the searched member is not found on some infered value but found on another (or don't issue anything in this case?)
The best solution would be to be able to understand the flow according to given argument value, but we're still far away from that...
|closed by||<not specified>|
- pylint #9188 Avoidable W0631
- pylint #2463 W0631 false positive when we are sure to do at least one iteration
- pylint #4024 W0631 false positive if a "else" clause is defining the loop variable
- logilab-astng #3291 failure of inference on overloaded operators
- logilab-astng #9515 strange message for non-class "Class baz has no egg member"