It is clear to me that None
is used to signify the lack of a value. But since everything must have an underlying value during implementation, I'm looking to see what value has been used in order to signify the absence of a value, regarding CPython
.
I understand, based on the documentation, that NoneObject
is a singleton. Since my c
skills are rusty, my best, amateur guess, would be that the value of None
would be the pointer to the memory allocated for the Py_None
object; since it is a singleton this would guarantee uniqueness. Or is it assigned to c
's NULL
which has a value of 0x0000
based on the second answer in this question?
Additionally, the documentation also points out:
Note that the PyTypeObject for None is not directly exposed in the Python/C API.
Which I'm guessing means you cannot find it searching through source. (Which I did, not knowing where to look, for object.c
naively believing I could understand anything)
But I'm not certain about my opinion on this so I asked.
What is the c
level value for the Py_None
object in CPython
?