[ python-Bugs-1516613 ] Decimal should allow leading or trailing spaces.

SourceForge.net noreply at sourceforge.net
Mon Jul 3 22:27:42 CEST 2006


Bugs item #1516613, was opened at 2006-07-03 17:27
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1516613&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Ronaldo Francisco Maia (romaia)
Assigned to: Nobody/Anonymous (nobody)
Summary: Decimal should allow leading or trailing spaces.

Initial Comment:
When creating a Decimal from a string, leading and
trailing spaces should be allowed, as it happens with
int and float:

>>> int(' 1 ')
1
>>> Decimal(' 1 ')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/decimal.py", line 571, in
__new__
    self._sign, self._int, self._exp =
context._raise_error(ConversionSyntax)
  File "/usr/lib/python2.4/decimal.py", line 2267, in
_raise_error
    raise error, explanation
decimal.InvalidOperation


If we look at decimal.py, the code (regex) is already
there, but commented.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1516613&group_id=5470


More information about the Python-bugs-list mailing list