Infinitely nested containers
ethan at stoneleaf.us
Sat Nov 22 20:50:19 CET 2014
On 11/21/2014 08:43 PM, Steven D'Aprano wrote:
> random832 at fastmail.us wrote:
>> I think I tried on at least one python version and printing the tuple
>> crashed with a recursion depth error, since it had no special protection
>> for this case the way list printing does.
> It works fine now (Python 3.3).
> py> L = 
> py> t = (L, None)
> py> L.append(L)
> py> L.append(t) # For good measure.
> py> print(t)
> ([[...], (...)], None)
This is a tuple in a list in a tuple, not a tuple in a tuple.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: OpenPGP digital signature
More information about the Python-list