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 mark.dickinson
Recipients mark.dickinson, romaia
Date 2007-11-25.03:17:06
SpamBayes Score 0.03741389
Marked as misclassified No
Message-id <1195960628.75.0.464180178981.issue1516613@psf.upfronthosting.co.za>
In-reply-to
Content
This is a feature request rather than a bug.  There's a least one good 
reason not to do this, namely that the specification on which the decimal 
module is based specifically disallows this:  At

http://www2.hursley.ibm.com/decimal/daconvs.html

it says:  "No blanks or other white space characters are permitted in a 
numeric string.", and the "to-number" operation of the specification, 
which converts strings to Decimal instances, is expected only to accept 
numeric strings.

Of course, all the specification requires is that the functionality of to-
number is present in the Decimal module *somewhere*:  currently it's 
implemented by Decimal.__new__, but it would be possible to alter 
Decimal.__new__ to allow leading and trailing spaces, and have a strictly 
conforming to-number implementation elsewhere in the Decimal module.  I 
don't think there's any real benefit to this.  It's easy enough to add a 
call to strip() to the Decimal argument.

I recommend closing this issue as a "won't fix".
History
Date User Action Args
2007-11-25 03:17:09mark.dickinsonsetspambayes_score: 0.0374139 -> 0.03741389
recipients: + mark.dickinson, romaia
2007-11-25 03:17:08mark.dickinsonsetspambayes_score: 0.0374139 -> 0.0374139
messageid: <1195960628.75.0.464180178981.issue1516613@psf.upfronthosting.co.za>
2007-11-25 03:17:08mark.dickinsonlinkissue1516613 messages
2007-11-25 03:17:07mark.dickinsoncreate