Message170017
| Author |
hac.man |
| Recipients |
hac.man |
| Date |
2012年09月07日.22:47:53 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1347058075.63.0.395926246222.issue15882@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I think I may have found a problem with the code that constructs Infinity from tuples in the C _decimal module.
# pure python (3.x or 2.x)
>>> decimal.Decimal( (0, (0, ), 'F'))
Decimal('Infinity')
# _decimal
>>> decimal.Decimal( (0, (0, ), 'F'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]
Also, there is no unit test coverage for constructing these special values from tuples either. I have provided some that pass with the existing pure python code and with the modifications to the _decimal C code.
The unit tests can be applied to Python 2.7.x as well, if desired. They would go in the ExplicitConstructionTest.test_explicit_from_tuples() method. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年09月07日 22:47:55 | hac.man | set | recipients:
+ hac.man |
| 2012年09月07日 22:47:55 | hac.man | set | messageid: <1347058075.63.0.395926246222.issue15882@psf.upfronthosting.co.za> |
| 2012年09月07日 22:47:55 | hac.man | link | issue15882 messages |
| 2012年09月07日 22:47:54 | hac.man | create |
|