False positive with operator+ and lists (no-member) #4826
Labels
Bug 🪲
False Positive 🦟
A message is emitted but nothing is wrong with the code
Minor 💅
Polishing pylint is always nice
Needs astroid update
Needs an astroid update (probably a release too) before being mergable
Bug description
When using
operator+
to merge two lists (in the context of a class method?), pylint incorrectly thinks that the objects in the combined list are also of typelist
.The simplest example I can construct is the following:
Configuration
No response
Command used
Pylint output
Expected behavior
I would expect there to be no warning, since both
self
andself.Alist
are (nominally) of typeA
, which does have a member calleddata
.If instead of using
[self] + self.Alist
, any of the following will not result in a warning:for a in [self]
for a in self.Alist
Pylint version
OS / Environment
CentOS 8.4
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: