-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Breaking changes for 4.0 🦤MaintenanceDiscussion or action around maintaining pylint or the dev workflowDiscussion or action around maintaining pylint or the dev workflowpyreverseRelated to pyreverse componentRelated to pyreverse component
Milestone
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
Metadata
Metadata
Assignees
Labels
Breaking changes for 4.0 🦤MaintenanceDiscussion or action around maintaining pylint or the dev workflowDiscussion or action around maintaining pylint or the dev workflowpyreverseRelated to pyreverse componentRelated to pyreverse component