Graph.edges_attribute

Graph.edges_attribute(name, value=None, keys=None)[source]

Get or set an attribute of multiple edges.

Parameters:
namestr

The name of the attribute.

valueobj, optional

The value of the attribute.

keyslist[tuple[hashable, hashable]], optional

A list of edge identifiers.

Returns:
list[Any] | None

A list containing the value per edge of the requested attribute, or None if the function is used as a “setter”.

Raises:
KeyError

If any of the edges does not exist.