None is negative?
mithrandiragainwiki at mailinator.com
Tue Aug 3 22:34:40 CEST 2010
-----BEGIN PGP SIGNED MESSAGE-----
On 08/03/2010 01:28 PM, Mithrandir wrote:
> On 08/03/2010 01:17 PM, wheres pythonmonks wrote:
>> I did the google search... I must be blind as I don't see any hits...
>> None is negative in Python? (v2.6)
>>>>> if None < -9999999.99: print "hi"
>>>>> if -9999999 > None: print "hi"
>> Is there a way to have the comparison raise an exception?
> I believe it's also because None lacks any binary value at all, whereas
> -99999999.99 or 0 have a value in binary.
> For example:
> if None < 0: print "hi"
> if None > 0: print "hi"
> But in human terms, None == 0 and None > -9999999.99.
That and/or it works out better in Python 3. :)
People should read more.
"All that is gold does not glitter,
not all those who wander are lost;
the old that is strong does not wither,
deep roots are not reached by the frost.
- From the ashes a fire shall be woken,
a light from the shadows shall spring;
renewed shall be blade that was broken,
the crownless again shall be king."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
More information about the Python-list