Question about 'None'

Francis Girard francis.girard at free.fr
Thu Jan 27 15:58:24 EST 2005


Le vendredi 28 Janvier 2005 07:49, jfj a écrit :
> 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.

I see. There is some rule stating that all the strings are greater than ints 
and smaller than lists, etc.

What was the goal behind this rule ?

Francis Girard




More information about the Python-list mailing list