Facundo Batista added the comment: Mark Dickinson:
> 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 +1 to be more permissive in the __new__ regarding spaces, tabs, and even newlines. I'm -0 to add an special module that does not allow this. I don't see the value of it more than be compliant to the standard in that particular sentence. Guido van Rossum: > I'd say that accepting a trailing \n is a bug that should > be fixed. > > I think that ideally we'd be allowed to specify whitespace > around the value. I am always annoyed at programs that require Do you want to be able to do Decimal("3 ") but not Decimal("3\n")? That confused me, I always read "whitespace" here as all these characters, as in the string module: >>> string.whitespace '\t\n\x0b\x0c\r ' To be more practical about my point, I'm +1 to do a .strip() in __new__ before parsing the number. __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1780> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com