STINNER Victor <vstin...@python.org> added the comment:

> 1. Docs should be changed to encourage implementing the full gc protocol for 
> "all" containers.  Spell out what can go wrong if they don't.  Be upfront 
> about that history has, at times, proved us too optimistic about that ever 
> since weakrefs were added.

Would it make any sense to add an opt-in option to emit a warning when a new 
type is created with Py_TPFLAGS_HAVE_GC but it doesn't implement tp_traverse? 
Maybe also emit a warning if it doesn't implement tp_clear?

Maybe it could be a ResourceWarning emitted in development mode, when -X dev is 
used on the command line.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38006>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to