Serhiy Storchaka added the comment:

And this is the only case where type name followed with '()' is occurred in 
error message. The repr() shouldn't be used in error message because it can be 
too long (imagine 'x'*10**9 < None) and can raise an exception.

IMHO more correct would be message "unorderable types: int and NoneType", but 
it lose the information about operation.

Yet one option is to follow the template for other binary operators:

>>> 1 + None
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

----------

_______________________________________
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