WHUI! (was Re: [Python-Dev] Proposal: C API Macro to decrefand set to NULL)

Raymond Hettinger python at rcn.com
Thu Jul 15 15:17:48 CEST 2004


> Almost all tp_traverse implementations can (and should) look exactly
> alike:
> 
> Py_VISIT(member1);
> Py_VISIT(member2);
> ...
> Py_VISIT(member_n);
> return 0;

It does get a little more complicated for containers that loop over
their contents and possibly have other PyObject * fields also.

Still, I applied the macro to collections and itertools and found it to
be straight-forward and easy to use.


Raymond





More information about the Python-Dev mailing list