On 2/01/21 6:14 am, Jeff Allen wrote:
we may as well say that the required result takes the form of an iterable of the nodes, which may subsequently be iterated by a consumer.

In general you need more than that, I think. If you're printing
a representation of the graph, you want to know about the structure,
not just get a flat list of nodes.

But we must have to do something very similar to pickle arbitrary (potentially cyclic) structures, which is likewise dependent on special help from the particular built-in type. Can something be founded on |||__getstate__| ?

I don't think so. All the logic for dealing with cycles is buried
inside pickle -- __getstate__ just gets info about one object.

--
Greg

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/3FMDYC76POOMNJ4OZUOJ2U3KCEMTGPII/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to