RuntimeError: dictionary changed size during iteration
Batista, Facundo
FBatista at uniFON.com.ar
Thu Jan 20 13:46:53 EST 2005
[Terry Reedy]
#- You must be having a bad day ;-). From Lib Ref 2.1 Built-in
Well, that's actually true, :(
#- corresponding to the object's symbol table. The returned
#- dictionary should
#- not be modified: the effects on the corresponding symbol table are
#- undefined
I actually read that, but didn't understood that it returns THE dictionary
(well, that another name binding for the same object was happening).
Whatever, I don't get divorced every week, so forgive me.
I think that, as it's normal to do...
l = list(...)
for e in l[:]:
l.remove(e)
...insted of...
l = list(...)
for e in l:
l.remove(e)
..., in this case we should do...
>>> [e for e in vars().copy()]
['_[1]', 'e', 'v', '__builtins__', '__name__', '__doc__']
. Facundo
Bitácora De Vuelo: http://www.taniquetil.com.ar/plog
PyAr - Python Argentina: http://pyar.decode.com.ar/
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
ADVERTENCIA.
La información contenida en este mensaje y cualquier archivo anexo al mismo,
son para uso exclusivo del destinatario y pueden contener información
confidencial o propietaria, cuya divulgación es sancionada por la ley.
Si Ud. No es uno de los destinatarios consignados o la persona responsable
de hacer llegar este mensaje a los destinatarios consignados, no está
autorizado a divulgar, copiar, distribuir o retener información (o parte de
ella) contenida en este mensaje. Por favor notifíquenos respondiendo al
remitente, borre el mensaje original y borre las copias (impresas o grabadas
en cualquier medio magnético) que pueda haber realizado del mismo.
Todas las opiniones contenidas en este mail son propias del autor del
mensaje y no necesariamente coinciden con las de Telefónica Comunicaciones
Personales S.A. o alguna empresa asociada.
Los mensajes electrónicos pueden ser alterados, motivo por el cual
Telefónica Comunicaciones Personales S.A. no aceptará ninguna obligación
cualquiera sea el resultante de este mensaje.
Muchas Gracias.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050120/48719d38/attachment.html>
More information about the Python-list
mailing list