On Sat, Nov 22, 2014 at 3:43 PM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > random...@fastmail.us wrote: > >> There's no reason not to allow it with tuples, but you can't do it. >> Mainly because doing it in a single literal would require special >> syntax, whereas you can simply append to a list a reference to itself. > > You can't append a list to itself in a single expression, you have to create > the list first.
It's possible to have a list directly refer to itself: lst = [] lst.append(lst) It's not possible, with pure Python code, to create a tuple with a reference to itself, because you have to create a tuple with a single expression. Hence the comments about using the C API... and breaking stuff. ChrisA -- https://mail.python.org/mailman/listinfo/python-list