Message324666
Just noticed this myself when testing with Python 3.5-3.7:
>>> from decimal import Decimal
>>> d = Decimal('foo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]
With Python 2.7 I get this error instead:
decimal.InvalidOperation: Invalid literal for Decimal: 'foo'
I'm writing type conversion code and was planning to include the error message by Python along with some higher level explanation when reporting errors. `[<class 'decimal.ConversionSyntax'>]` would be such a strange message that I need to make a special case with decimal. |
|
Date |
User |
Action |
Args |
2018-09-06 07:29:10 | pekka.klarck | set | recipients:
+ pekka.klarck, rhettinger, mark.dickinson, petr.viktorin, skrah |
2018-09-06 07:29:10 | pekka.klarck | set | messageid: <1536218950.79.0.56676864532.issue26208@psf.upfronthosting.co.za> |
2018-09-06 07:29:10 | pekka.klarck | link | issue26208 messages |
2018-09-06 07:29:10 | pekka.klarck | create | |
|