Block.edge_attribute

Block.edge_attribute(edge, name, value=None)

Get or set an attribute of an edge.

Parameters:
edgetuple[int, int]

The identifier of the edge as a pair of vertex identifiers.

namestr

The name of the attribute.

valueobject, optional

The value of the attribute. Default is None.

Returns:
object | None

The value of the attribute, or None when the function is used as a “setter”.

Raises:
KeyError

If the edge does not exist.