Stefan Krah <stefan-use...@bytereef.org> 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 analysis, I would be very much in favour of this.

> Issue 3. I can't see how this could cause any real problems, since you'd 
> get an error as soon as you tried to use a bogus context.  Further, an 
> explicit typecheck goes against Python's duck-typing philosophy:  a 
> suitably crazy and misguided person ought to be able to create their own 
> 'quacks like a context' class, not necessarily inheriting from 
> Decimal.Context, and pass this into setcontext in place of a real 
> context.  I'm -0 on changing this.

Agreed, it's not really important.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6795>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to