Pekka Klärck <[email protected]> added the comment:
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.
----------
nosy: +pekka.klarck
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue26208>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com