Skip to content

networkx: type annotation needed for instantiating a graph #14389

@AckslD

Description

@AckslD

If I just do eg:

    graph = nx.DiGraph()

mypy complains that

var-annotated Need type annotation for "graph"

Is there some issues with the stubs here that makes mypy not understand that nx.DiGraph() instantiates an instance of the class DiGraph?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions