Re: list IndexError

From: Mike C. Fletcher (mcfletch_at_rogers.com)
Date: 12/23/04


Date: Thu, 23 Dec 2004 10:21:56 -0500
To: python-list@python.org

Fredrik Lundh wrote:

>Mike C. Fletcher wrote:
>
>
>
>>>yeah actually i saw what Fedrik had to say above. I created a sliced
>>>copy of the l & did my homework within the for loop
>>>
>>>
>>>
>>You might want to check it again before you hand it in ;) ...
>>
>>
...

>that's not the code he quoted in the mail you replied to, though...
>
>
Ah, my mistake, I missed the [:] after the source argument that was
taking a copy... which brings up the question, how many other people
would miss it? Guess it's just a matter of how often you see the
pattern, so you begin to expect the [:] and either look for it or take
it for granted (hmm, another source of bugs?).

Apologies for any unnecessary alarm,
Mike

________________________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://www.vrplumber.com
  http://blog.vrplumber.com



Relevant Pages