Open
Description
Bug description
when the Linker
works over astroid nodes and set attributes for them , e.g. when setting instance_attrs_type
node.instance_attrs_type = collections.defaultdict(list)
when trying to type hint this attributes like
node.instance_attrs_type: defaultdict[str, list[...]] = collections.defaultdict(list)
mypy throws an error like this
Type cannot be declared in assignment to non-self attribute [misc]
CC: @DudeNr33
Configuration
No response
Command used
tested with mypy on pre-commit
Pylint output
(no pylint related)
Expected behavior
being able to type hint new attributes for the nodes
Pylint version
(tested with source code)
OS / Environment
ubuntu 20.04
Additional dependencies
No response