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.0374139
Marked as misclassified No
Message-id <>
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

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".
Date User Action Args
2007-11-25 03:17:09mark.dickinsonsetspambayes_score: 0.0374139 -> 0.0374139
recipients: + mark.dickinson, romaia
2007-11-25 03:17:08mark.dickinsonsetspambayes_score: 0.0374139 -> 0.0374139
messageid: <>
2007-11-25 03:17:08mark.dickinsonlinkissue1516613 messages
2007-11-25 03:17:07mark.dickinsoncreate