Inconsistency in Python's Comparisons

Andrew Koenig ark at
Wed Mar 17 20:58:18 CET 2004

"Peter Hansen" <peter at> wrote in message
news:Ze6dncncZq9qCcXdRVn-tA at
> Andrew Koenig wrote:

> > "Erik Max Francis" <max at> wrote in message
> > news:4057B2A4.F9EC49DD at

> >>Do you have an example of this that doesn't involve comparisons between
> >>different types?

> > Do long and float count as different types?
> Was this a trick question?

Not particularly.  Although long and float are obviously different types, I
suspect that most people who say that they do not expect comparisons between
different types to work, they do expect comparisons to work consistently
between integers and floating-point values.

More information about the Python-list mailing list