On Sat, Nov 22, 2014 at 4:39 AM, <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. > > 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.
You can do it in C, I believe - PyTuple_New() followed by PyTuple_SetItem(x, 0, x) should do it. ChrisA -- https://mail.python.org/mailman/listinfo/python-list