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...

done in0.13.0
load left0.000
closed by<not specified>