Message251536
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. |
|
Date |
User |
Action |
Args |
2015-09-24 15:45:31 | r.david.murray | set | recipients:
+ r.david.murray, vstinner, ezio.melotti, Mark.Shannon, serhiy.storchaka |
2015-09-24 15:45:31 | r.david.murray | set | messageid: <1443109531.05.0.494153944673.issue25210@psf.upfronthosting.co.za> |
2015-09-24 15:45:31 | r.david.murray | link | issue25210 messages |
2015-09-24 15:45:30 | r.david.murray | create | |
|