[issue10576] Add a progress callback to gcmodule

Antoine Pitrou report at bugs.python.org
Sat Mar 31 15:35:27 CEST 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

> - gc.callbacks is a simple module attribute.  Anyone can set it to
> anything else, e.g. gc.callbacks=None.  We have to accomodate this
> possibility or else introduce annoying api functions to edit the list.
> I thought it best to do things similarly to sys.import_hooks etc,
> simply expose a list object and trust the user to treat this list
> object with care, but check it regardless to avoid crashing.

The way I read it, you don't fetch it from the module dictionary,
though, you just use the static C variable, which shouldn't change when
the dict is mutated.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10576>
_______________________________________


More information about the Python-bugs-list mailing list