[issue6795] decimal.py: minor issues && usability

2009-09-08 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed in r74719 (release26-maint), r74720 (release31-maint). -- resolution: -> fixed stage: -> committed/rejected status: open -> closed versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2 ___ Python tracker

[issue6795] decimal.py: minor issues && usability

2009-09-07 Thread Mark Dickinson
Mark Dickinson added the comment: On second thoughts, I'm going to call this a bug and backport to 2.6 and 3.1. -- ___ Python tracker ___ ___

[issue6795] decimal.py: minor issues && usability

2009-09-07 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed __long__ bug and changed behaviour of int(Decimal('nan')) in r74708 (trunk), r74709 (py3k). I still need to fix the __long__ bug in the release branches. -- ___ Python tracker

[issue6795] decimal.py: minor issues && usability

2009-09-07 Thread Stefan Krah
Stefan Krah added the comment: [...] > But in Python this error condition *can* 'otherwise be indicated', by > raising a suitable Python exception. So I propose changing the decimal > module in 2.7 and 3.2 so that int(Decimal('nan')) and > long(Decimal('nan')) raise ValueError. Excellent an

[issue6795] decimal.py: minor issues && usability

2009-09-04 Thread Facundo Batista
Facundo Batista added the comment: Issue 1: +1 to raise ValueError Issue 3: -0 to change actual behaviour Thanks! -- ___ Python tracker ___

[issue6795] decimal.py: minor issues && usability

2009-08-28 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the reports. Issue 1. If this is going to be changed, I'd rather see int(Decimal('nan')) raise ValueError (just as int(float('nan')) does) than return None. Conversions from Decimal to native integers lie outside the scope of the standard, so the

[issue6795] decimal.py: minor issues && usability

2009-08-28 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> marketdickinson nosy: +marketdickinson ___ Python tracker ___ ___ Python-bugs-list mailing

[issue6795] decimal.py: minor issues && usability

2009-08-28 Thread Stefan Krah
New submission from Stefan Krah : Hi, a couple of minor issues: 1: >>> c = getcontext() >>> c.traps[InvalidOperation] = False >>> Decimal("NaN").__int__() Decimal('NaN') I think the return value should be None. 2: >>> c = getcontext() >>> c.traps[InvalidOperation] = False >>> Decimal("NaN").