networkx.utils.to_tuple

networkx.utils.to_tuple(x)[source]

Converts lists to tuples.

For example:

>>> from networkx.utils import to_tuple
>>> a_list = [1, 2, [1, 4]]
>>> to_tuple(a_list)
(1, 2, (1, 4))