On 2/13/06, John Salerno <[EMAIL PROTECTED]> wrote:
> I'm having some slight trouble understanding exactly why this creates an
> infinite loop:
>
> L = [1, 2]
> L.append(L)

'L' is a pointer to a list. You are now adding that pointer to the
very list it points to.

What you're looking for is:

L = [1, 2]
L.append(L[:])

--

# p.d.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to