This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author facundobatista
Recipients facundobatista, gvanrossum, mark.dickinson, rhettinger
Date 2008-01-11.11:26:01
SpamBayes Score 0.00012755085
Marked as misclassified No
Message-id <1200050764.08.0.187491491134.issue1780@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-01-11 11:26:04facundobatistasetspambayes_score: 0.000127551 -> 0.00012755085
recipients: + facundobatista, gvanrossum, rhettinger, mark.dickinson
2008-01-11 11:26:04facundobatistasetspambayes_score: 0.000127551 -> 0.000127551
messageid: <1200050764.08.0.187491491134.issue1780@psf.upfronthosting.co.za>
2008-01-11 11:26:02facundobatistalinkissue1780 messages
2008-01-11 11:26:01facundobatistacreate