![](https://secure.gravatar.com/avatar/4ebd537df10ab19b4c524299026d936e.jpg?s=120&d=mm&r=g)
March 19, 2016
10:24 a.m.
Guido van Rossum <guido <at> python.org> writes:
I don't care too much either way, but I think passing underscores to the constructor shouldn't be affected by the context -- the underscores are just removed before parsing the number. But if it's too complicated to implement I'm fine with punting.
Just removing the underscores would be fine. The problem is that per the PEP the conversion should happen according the Python float grammar but the actual decimal grammar is the one from the IBM specification. I'd much rather express the problem like you did above: A preprocessing step followed by the IBM specification grammar. Stefan Krah