[issue2482] Decimal(unicode)

2008-03-25 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: The original bug here is fixed, so I'm closing this issue. I've opened a separate issue (issue 2486) for discussing changing the Decimal coefficient from str to bytes. -- resolution: -> fixed status: open -> closed ___

[issue2482] Decimal(unicode)

2008-03-25 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: str -> unicode regression fixed in r61904, r61906. (I backported the fix to 2.5; it's not absolutely clear that it's worth it, but this *is* a bug, and it seems worth not letting the various decimal.py versions diverge too much.)

[issue2482] Decimal(unicode)

2008-03-25 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: I'm not sure that converting to bytes for Python 3.0 is going to be a simple change. For one thing, most of the arithmetic functions have to do the reverse conversion (int -> str/bytes) at some point. At the moment, an int -> bytes conversio

[issue2482] Decimal(unicode)

2008-03-25 Thread Facundo Batista
Facundo Batista <[EMAIL PROTECTED]> added the comment: Decimal needs to grow something like the following near the top of the module: try: _bytes = bytes except NameError: # 2.5 or earlier _bytes = str and then use _bytes instead of str as appropriate throughout the rest of the module. Thi

[issue2482] Decimal(unicode)

2008-03-25 Thread Mark Dickinson
Changes by Mark Dickinson <[EMAIL PROTECTED]>: -- assignee: -> marketdickinson nosy: +marketdickinson versions: +Python 2.6 __ Tracker <[EMAIL PROTECTED]> __ _

[issue2482] Decimal(unicode)

2008-03-25 Thread Oleg Broytmann
New submission from Oleg Broytmann <[EMAIL PROTECTED]>: Decimal(u'123').to_eng_string() returns unicode in Python 2.5.2. That's probably due to the optimization in decimal module, after which decimal stores coefficient (mantissa) as a str, and doesn't coerce input to str. See the thread at http: