Skip to content

Document how to use basic type annotations with PyGraph #1558

@johnthagen

Description

@johnthagen

What is the expected enhancement?

I find being able to statically type the generic Graph() from NetworkX to be a very useful feature for maintainability and self-documentation for other developers. Could we add some very simple docs so that if someone searching "typing" or similar in the user guide they are brought to a short example that documents how to type a PyGraph with its node and edge types? It took me a while of digging through issues to learn that typing the generic types was supported.

For example, it's not immediately clear to me without digging through the source code what the order of the generic parameters to PyGraph[Any, Any] are.

I think this would also make the feature more discoverable for new users.

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