the code necessary to accomplish this is simpler and faster if confined to
the object implementations, so we only do this there.
This causes no behaviorial changes beyond a (very slight) speedup.
/* Any changes should be reflected in PyObject_INIT (objimpl.h) */
op->ob_type = tp;
_Py_NewReference(op);
- if (PyType_SUPPORTS_WEAKREFS(tp)) {
- PyObject **weaklist = PyObject_GET_WEAKREFS_LISTPTR(op);
- *weaklist = NULL;
- }
return op;
}