Title: no integration with java.math.BigDecimal and java.math.BigInteger
Type: Severity: normal
Components: Core Versions: Jython 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: doublep, fwierzbicki, jeff.allen, santa4nt, zyasoft
Priority: normal Keywords:

Created on 2011-04-18.14:01:52 by doublep, last changed 2018-03-17.17:43:22 by jeff.allen.

msg6497 (view) Author: (doublep) Date: 2011-04-18.14:01:51
Trivial to reproduce:

>>> from java.math import BigDecimal
>>> BigDecimal ('1.00') - BigDecimal ('0.50')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for -: 'java.math.BigDecimal' and 'java.math.BigDecimal'

At the very least Jython should allow arithmetics of a java.math type with itself.  Ideally it should smoothly handle cross-type arithmetics as well.
msg7708 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2013-02-19.23:49:33
The workaround is pretty easy as I'm sure you know: use BigDecimal's add method. If someone wants to submit a patch that handles this I'd be happy to review it. It should go against 2.7 though.
msg9898 (view) Author: Jim Baker (zyasoft) Date: 2015-04-19.22:36:43
We could follow the semantic equivalence we do with ducktyping List, Map, Set like a list, dict, set, etc, as was done with #2215 and similar bugs.

Adding Santoso in case he's interested.
msg11826 (view) Author: Jeff Allen (jeff.allen) Date: 2018-03-17.17:43:21
Compare also #2090, #2216 and the different philosophy that #2382 represents. (#msg11801 refers)
Date User Action Args
2018-03-17 17:43:22jeff.allensetpriority: low -> normal
nosy: + jeff.allen
messages: + msg11826
2015-04-19 22:36:44zyasoftsetnosy: + santa4nt, zyasoft
messages: + msg9898
2013-02-19 23:49:33fwierzbickisetpriority: low
nosy: + fwierzbicki
messages: + msg7708
versions: + Jython 2.7, - 2.5.2rc
2011-04-18 14:01:52doublepcreate