very strange problem in 2.4
conor.robinson at gmail.com
conor.robinson at gmail.com
Mon Apr 10 14:42:33 EDT 2006
Ok, so I found out that even though mylist[] and all objects in it were
fine ie id(mylist[i]) != id(mylist[all others]) what was happening is
that during a reproduction function a shallow copies were being made
making all offspring (genetic algorithm) have different
id(mylist[0..n]), however the actual attributes were referenced for
offspring on the same parent(s). Fixed it with a deepcopy and used
properties insead of java like get sets.
thanks for all the help,
Conor
More information about the Python-list
mailing list