Serhiy Storchaka added the comment: There is other code that sets refcount.
Include/object.h:764: Py_REFCNT(op) = 1) Objects/moduleobject.c:38: Py_REFCNT(def) = 1; Objects/longobject.c:5450: Py_REFCNT(op) = refcnt + 1; Objects/unicodeobject.c:1762: Py_REFCNT(unicode) = 3; Objects/unicodeobject.c:15044: Py_REFCNT(s) -= 2; Objects/unicodeobject.c:15103: Py_REFCNT(s) += 1; Objects/unicodeobject.c:15107: Py_REFCNT(s) += 2; I would suggest to set initial refcount to 1000000000, define Py_REFCNT(s) as returning constant 1000000000, and fix subsequent compiler errors. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26891> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com