En Wed, 08 Jul 2009 14:09:43 -0300, Cameron Pulsford
<[email protected]> escribió:
I'm representing the board as a dictionary, where the keys are
(x, y) positions, and the values are candidates. So my program goes along
picking numbers from the list of candidates and then propagating the
constraints. [...]Basically my boards list should be copies of good
boards, and when I need to
refresh the current board, I want to pull off a copy of the correct one.
[...] this isn't happening. I am always modifying the same board.
You have a dictionary whose values are lists, ok? The copy() method
doesn't make a copy of those lists - only of the dictionary itself. Try
using the deepcopy function in the copy module:
http://docs.python.org/library/copy.html
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list