tworld icon indicating copy to clipboard operation
tworld copied to clipboard

Treatment of tuples in propcache is probably wrong

Open erkyrath opened this issue 11 years ago • 0 comments

The deepcopy() function assumes that a tuple is immutable, which is not true. deepcopy( ([], []) ) will return the object itself, for example, which will lead to sadness.

I think all of the propcache will have to assume that tuples are "mutable". Then it will have to be smart about checking them for mutation. (x=() will wind up as [] eventually, somewhere down in the guts. I suppose the propcache could ignore this, but it seems like poor planning.)

Maybe I should just convert tuples to lists as they enter the propcache? But this will also have to be deep, to catch [()].

Maybe I can do the conversion in deepcopy() -- that much is easy -- and then invent a scheme where that solves the problem...?

erkyrath avatar Oct 07 '13 03:10 erkyrath