Skip to content

Turn ImportFrom.names into a list of NamedTuple #1339

Open
@tristanlatr

Description

@tristanlatr

Current behavior

Each entry is a tuple of the name being imported, and the alias that the name is assigned to (if any).

Expected behavior

Have something that acts like an ast.alias object.
So that could be acheived by using NamedTuple, this would keep the compatibility with the normal tuple usage and would allow to be used like it was an ast.alias object, such that less effort is needed to adopt astroid.

alias = namedtuple('alias', ('name', 'asname'))

Astroid version: 2.9.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions