Python (and me) getting confused finding keys

Robin Becker robin at reportlab.com
Tue Dec 22 11:44:16 EST 2009


On 22/12/2009 16:33, John wrote:
> Hi there,
>
> I have a rather lengthy program that troubles me for quite some time. After
> some debugging, I arrived at the following assertion error:
>
> for e in edges.keys():
> 	assert edges.has_key(e)
>
> Oops!? Is there ANY way that something like this can possibly happen?
>
> Cheers,
> John
another thread can remove the key prior to the has_key call; or perhaps edges 
isn't a real dictionary?

-- 
Robin Becker




More information about the Python-list mailing list