[Python-Dev] very slow compare of recursive objects

Tim Peters tim.one@comcast.net
Mon, 20 Jan 2003 10:59:30 -0500


[Neal Norwitz]
> What about:
>
>         >>> t = ([],)
>         >>> t[0].append(t)
>         >>> print t
>         ([([...],)],)
>         >>> print t[0][0] is t
>         True
>
> Not sure if that's a tuple containing a recursive structure or a
> recursive tuple.

It's both, as was my example too.  Note that it required mutation of a
mutable container object to create it.