On Wed, 18 Mar 2020 at 13:22, Paolo Bonzini <pbonz...@redhat.com> wrote: > Here are some random thoughts about it: > > - object initialization should cause no side effects outside the subtree > of the object > > - setting properties can cause side effects outside the subtree of the > object (e.g. marking an object as "in use"), but they must be undone by > finalization. > > - realization can also cause side effects outside the subtree of the > object, but if unrealization is possible, they must be undone by > unrealization. if an object is realized and unrealization is not > possible, finalization will never run (and in that case, side effects of > realization need not be undone at all).
- if realization fails then any side effects caused by the partial realize must be undone before returning the failure. (I bet we don't always get this right, especially in cases where a subclass has to call a parent class realize method...) thanks -- PMM