R. David Murray added the comment:

That's why I said that making it like the other binary op messages might be 
better.  Currently the error message says that the error is that two types were 
compared ("unorderable types"), which as you point is not quite accurate.  It 
is, however, fairly parallel to the message used for binary operations:

   TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

I think it would be good to change the existing message to match:

   TypeError: unsupported operand type(s) for '<': 'int' and 'NoneType'

The *best* change would be something like:

   TypeError: '<' does not support comparison of operands whose types are 'int' 
and 'NoneType'
   TypeError: '+' does not support addition of operands whose types are 'int' 
and 'NoneType'

But that might be much harder to implement depending on how the binary op error 
message(s) are implemented.  Leave out "addition of" and "comparison of" in the 
above messages and they might still be better than the status quo, but probably 
not enough to warrant doing it if doing it is hard.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to