Skip to content

calling parent on a node that is part of a type comment returns the (original) _ast module's FunctionDef #851

@ltcmelo

Description

@ltcmelo

Consider this snippet:

def f(s): # type: (str) -> int return 42

Given the node from the type comment, Name.int(name='int'), if I call its parent (i.e., node.parent), I get the original _ast module's FunctionDef, instead of astroid's FunctionDef.

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