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)

Gives:
[[0], [0]]
1

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

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to