[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-08-02 Thread Mark Dickinson
Mark Dickinson added the comment: Backported to trunk and release26-maint in r74281 and r74282. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-08-02 Thread Mark Dickinson
Mark Dickinson added the comment: Committed to py3k in r74279, release31-maint in r74280. Leaving open for backport to 2.x. -- ___ Python tracker ___ __

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-07-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: I like the str(int(...)) approach because it guarantees handling that is consistent with other types. -- ___ Python tracker ___

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-07-30 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the feedback; I've added 2.6, 2.7, 3.1 to the versions and will backport. [Eric] > Since you're calling int() on the result, can't this code: > self._int = str(int((intpart+fracpart).lstrip('0') or '0')) > just be: > self._int = str(int(intpart+frac

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-07-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 Also, I would like to see this backported. We've long promised that any variance with the spec will be treated as a bugfix. The change won't break any existing code. -- nosy: +rhettinger ___ Python tracker

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-07-29 Thread Eric Smith
Eric Smith added the comment: Since you're calling int() on the result, can't this code: self._int = str(int((intpart+fracpart).lstrip('0') or '0')) just be: self._int = str(int(intpart+fracpart)) ? And here, you already know diag is not None, so do you need the "or '0'" part? self._int = str(i

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-07-29 Thread Eric Smith
Eric Smith added the comment: +1 The standard recommends it, and the other numeric types support it, so Decimal should as well. -- nosy: +eric.smith ___ Python tracker ___ _

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-07-29 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch -- keywords: +patch Added file: http://bugs.python.org/file14593/issue6595.patch ___ Python tracker ___ _

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-07-29 Thread Mark Dickinson
New submission from Mark Dickinson : Ezio Melotti asked (on #python-dev) why the Decimal constructor doesn't accept decimal digits other than 0-9. As far as I can tell there's no good reason for it not to. Moreover, the standard on which the decimal module is based says[1]: """It is recomme