Incomparable abominations (was: python-dev Summary)

Donn Cave donn at drizzle.com
Sun Mar 23 01:38:54 CET 2003


Quoth "Tim Peters" <tim_one at email.msn.com>:

| I think it's approximately impossible to explain why
|
|     1 + "2"
|
| raises an exception now, but
|
|     1 < "2"
|
| doesn't.  In the earliest Pythons, for obscure technical reasons it wasn't
| *possible* for a comparison operation to raise an exception, and I expect
| the current inconsistency was driven at least as much by that technical
| glitch as by deliberate choice.

What about

      1 == "2"

, should it also be cause for an exception?  Sorry if I missed the
earlier posts in this thread that would explain how == differs from
< in this application.

	Donn Cave, donn at drizzle.com




More information about the Python-list mailing list