Open ZeeD opened 4 years ago
I looked into this and the reason is decidedly because prev
, assigned as prev: typing.Optional[typing.List[str]] = None
is initialized as None. While unsupported-assignment-operation
is a red herring, it's telling the author to not initialize a value intended to be a list to a None
type, instead initialize to []
.
Would be nice if pylint had (does it have??) instead a warning to let us know if we've initialized the incorrect empty value for the type. But I'm not sure the particular issue as posed here is worth fixing?
I mean, the typing says it can be None
so it being None
seems fine? The main issue is that we don't understand the assertion, for which an astroid
PR has been in the making for quite some time now.
I have this little module:
while it does what I expect (it prints
['foo', 'bar baz']
), pylint says that there is an error:pylint --version output