Skip to content

Stable API for all node name #1811

@Pierre-Sassoulas

Description

@Pierre-Sassoulas

Current behavior

We often have the following code in pylint:

if isinstance(node, nodes.Attribute):
    name = node.attrname
else:
    name = node.name

This is the reason for a lot of crashes too.

Expected behavior

Maybe it would be a good thing to have a name attribute that return attrname if required ? (I don't think if we have nodes who have both name and attrname.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions