Why PyINCREF on _PyFalseStruct and _PyTrueStruct?
i at introo.me
Wed Apr 8 17:07:52 CEST 2015
While reading the rich_compare of PyLongObject, I noticed this line:
It increments the ob_ref of the builtin True/False object.
Initializing the ob_ref of True/False to one so that they won't be
garbage collected if fair enough. Why do we increment it?
I don't see the reason behind it, since these two objects should
always stay in the memory and never participate the garbage collecting
More information about the Python-list