Amaury Forgeot d'Arc added the comment: PyWeakref_GET_OBJECT is also potentially dangerous: since the refcount is not incremented, it's very possible that the GC collects it.
The only safe operation after PyWeakref_GET_OBJECT is to Py_XINCREF the result. Should we provide a PyWeakRef_LockObject()? ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16602> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com