Ethan Furman wrote: > On 11/21/2014 08:43 PM, Steven D'Aprano wrote: >> random...@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.
Really? I hadn't noticed. *wink* It's still a tuple in itself, recursively, and the tuple to str conversion routine still has to deal with the fact. -- Steven -- https://mail.python.org/mailman/listinfo/python-list