maxcountryman/atomos — pull request #1 by maxcountryman (2014-10-31 21:57:22+00:00)
Title: remove copy.deepcopy

This removes uses of copy.deepcopy which proved problematic when dealing
with certain kinds of objects. However it is worth noting that the
original intention of deepcopy was to provide some protection against
accidental mutation of shared object references. In particular, if a
function passed to Atom.swap mutates the reference to oldval then it can
loop indefinitely! Callers are now responsible for ensuring this does
not happen. Additionally watches are affected because they are passed
the same references to oldval and newval; likewise they must take care
to not mutate these references. Instead in either case the reference
should be copied or in some way used without mutating the shared
reference. Note that persistent data structures are one method for
dealing with this problem.