zope.copy API Reference


API for zope.copy

exception zope.copy.interfaces.ResumeCopy[source]

Don’t use the hook, resume the copy.

This is a special exception, raised from the copy hook to signal copier that it should continue copying the object recursively.

See ICopyHook.__call__ method documentation.

interface zope.copy.interfaces.ICopyHook[source]

An adapter to an object that is being copied

__call__(toplevel, register)[source]

Given the top-level object that is being copied, return the version of the adapted object that should be used in the new copy.

Raising ResumeCopy means that you are foregoing the hook: the adapted object will continue to be recursively copied as usual.

If you need to have a post-copy actions executed, register a callable with register. This callable must take a single argument: a callable that, given an object from the original, returns the equivalent in the copy.

See README.txt for more explanation.