Open pylint-bot opened 9 years ago
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):
This is an example of why we should have flow control understanding in pylint. In configparser.py, in the .get() implementation, we can find this code:
#!python
try:
value = d[option]
except KeyError:
if fallback is _UNSET:
raise NoOptionError(option, section)
else:
return fallback
Basically pylint (astroid) is really dumb here and infers all the possible returns, disregarding the if statement and the possiblity that d might raise a KeyError. Hopefully I'll work on flow control after pylint 1.5.
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):
By the way, I don't know why it worked fine with pylint 1.4.1, but I presume the same inference occurred with it as well.
Originally reported by: Florian Bruhin (BitBucket: The-Compiler, GitHub: @The-Compiler?)
Since pylint 1.4.2 and astroid 1.3.5, the following snippet:
gives me
Instance of 'object' has no 'split' member (no-member)
. It worked fine with pylint 1.4.1 and astroid 1.3.4.