Question about 'None'

jfj jfj at freemail.gr
Fri Jan 28 01:49:37 EST 2005


Francis Girard wrote:

> Wow ! What is it that are compared ? I think it's the references (i.e. the 
> adresses) that are compared. The "None" reference may map to the physical 0x0 
> adress whereas 100 is internally interpreted as an object for which the 
> reference (i.e. address) exists and therefore greater than 0x0.
> 
> Am I interpreting correctly ?
> 
>

Not really. If objects of different types are compared (like compare a
string with a list), then no matter what, all strings but be "smaller"
than all lists. Or the oposite.

So the fast way to accomplish this is to compare the addresses of the
object's method table. Something which is common for all objects of
the same type.


G.





More information about the Python-list mailing list