[Python-Dev] What's a PyStructSequence ?

M.-A. Lemburg mal@lemburg.com
Wed, 28 Nov 2001 10:15:53 +0100


Mark Hammond wrote:
> 
> > Py_True, of course, *is* 1. There is no proper boolean type.
> 
> Seeing you added emphasis on the *is*, I assume you meant *is* :)
> 
> >>> true=(1==1)
> >>> true is 1
> 0
> >>>
> 
> Py_True == 1, but is *not* 1

Py_True is a singleton and all 1 integers in Python are cached
and shared, so we end up having exactly two different objects
for the number 1 in Python: Py_True and 1 (or 3-2 or 4/4 or ...).

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/