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, santa4nt, zyasoft
Priority: low Keywords:

Created on 2011-04-18.14:01:52 by doublep, last changed 2015-04-19.22:36:43 by zyasoft.

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.
Date User Action Args
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