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...
|appeared in||<not specified>|
|closed by||<not specified>|
- logilab-astng #3207 filter infered values according to if statement
- logilab-astng https://bitbucket.org/logilab/astroid/ Python Abstract Syntax Tree New Generation
- logilab-astng #2453 handle external modification of a class
- logilab-astng #18953 Inference fails with augmented assignment
- logilab-astng #3158 use logging to allow pylint to get (at least) inference error information