This example shows only enough of the implementation of an extension
type to show how the garbage collector support needs to be added. It
shows the definition of the object structure, the
tp_traverse, tp_clear and tp_dealloc
implementations, the type structure, and a constructor -- the module
initialization needed to export the constructor to Python is not shown
as there are no special considerations there for the collector. To
make this interesting, assume that the module exposes ways for the
container field of the object to be modified. Note that
since no checks are made on the type of the object used to initialize
container, we have to assume that it may be a container.