1. tomo cocoa
  2. jython


Frank Wierzbicki  committed 43ea969 Merge

Merge with 2.5.

  • Participants
  • Parent commits d0b31f0, 18db8d1
  • Branches default

Comments (0)

Files changed (1)

File Lib/decimal.py

View file
         # of the formatting to the _format_number function
         return _format_number(self._sign, intpart, fracpart, exp, spec)
+    # support for Jython __tojava__:
+    def __tojava__(self, java_class):
+        if java_class not in (BigDecimal, Object):
+            return Py.NoConversion
+        return BigDecimal(str(self))
 def _dec_from_triple(sign, coefficient, exponent, special=False):
     """Create a decimal instance directly, without any validation,
     normalization (e.g. removal of leading zeros) or argument