[issue1780] Decimal constructor accepts newline terminated strings

Mark Dickinson report at bugs.python.org
Fri Jan 11 02:49:27 CET 2008


Mark Dickinson added the comment:

I can certainly fix the Decimal constructor to reject trailing newlines, if 
that's what people want, but that doesn't fit with the proposal to accept 
and strip leading and trailing whitespace.

The other option that maintains full compliance with the specification is 
to do what we like with Decimal.__new__ (e.g. allowing leading and trailing 
whitespace), but make sure that there's a fully conforming to-number 
elsewhere in the Decimal module.

I'm happy to make either of the above fixes, or to do nothing (which leaves 
us with a slightly buggy implementation of the specification---but probably 
not so that anyone would notice).  I'll leave the decision of which of 
these three options is most desirable to the more seasoned developers.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1780>
__________________________________


More information about the Python-bugs-list mailing list