Recursive structures

bearophileHUGS at bearophileHUGS at
Mon Dec 20 19:21:08 CET 2004

Thank you very much Thomas Güttler for you quick answer, but I think
your program doesn't contain an algorithm to spot cycles (like the
usual cyclic graph algorithm). In my first post there was an assert to
spot this problem:

l = [0]
m = [l, l]
print m
print isrecursive(m)

[[0], [0]]

m contains a shared reference, but not a recursive one.
Thank you Fredrik Lundh too,
bear hugs,

More information about the Python-list mailing list