On Wed, Sep 16, 2015 at 10:29 AM, Rafael David <rdavid...@gmail.com> wrote: > Oooohhh ... I think I got it! I'm assigning a reference to peca and not the > value itself! Thank you very much MRAB and C Smith for the enlightenment :)
Right! That's how Python's assignment always works. You may find, in your case, that you can simply reassign peca={} every time through the loop. No copying necessary - just make yourself a new dict for each iteration. And you might be able to do the whole thing with a gigantic list/list/dict comprehension, but that may or may not be an improvement on your code :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list