Issue2786

classification
Title: Subtracting a Long from None produces TypeError: xxx
Type: Severity: normal
Components: Core Versions: Jython 2.7
Milestone:
process
Status: open Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: chcooper, zyasoft
Priority: low Keywords:

Created on 2019-07-18.19:08:04 by chcooper, last changed 2019-07-18.21:41:03 by zyasoft.

Messages
msg12580 (view) Author: Christopher Cooper (chcooper) Date: 2019-07-18.19:08:04
>>> 3L - None
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for -: 'long' and 'NoneType'
>>> None - 3L
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: xxx
>>> None - 3.0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
msg12582 (view) Author: Jim Baker (zyasoft) Date: 2019-07-18.21:37:38
These errors conform with CPython 2.7:

% python
Python 2.7.14 (default, Apr 25 2018, 15:22:05)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 3L - None
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for -: 'long' and 'NoneType'
>>> None - 3L
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for -: 'NoneType' and 'long'
>>> None - 3.0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
msg12584 (view) Author: Jim Baker (zyasoft) Date: 2019-07-18.21:39:48
One minor: we should fix the specific error message for 

>>> None - 3L
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: xxx

That specific error message of xxx looks like a TODO.
msg12586 (view) Author: Jim Baker (zyasoft) Date: 2019-07-18.21:41:03
Ooops, I was reading the report wrong, it's exactly about the xxx in the error message. Sorry about that!
History
Date User Action Args
2019-07-18 21:41:03zyasoftsetpriority: low
status: closed -> open
resolution: invalid -> accepted
messages: + msg12586
2019-07-18 21:39:48zyasoftsetmessages: + msg12584
2019-07-18 21:37:38zyasoftsetstatus: open -> closed
resolution: invalid
messages: + msg12582
nosy: + zyasoft
2019-07-18 19:08:04chcoopercreate