[Python-ideas] Floating point contexts in Python core

Chris Angelico rosuav at gmail.com
Thu Oct 11 16:11:45 CEST 2012


On Fri, Oct 12, 2012 at 12:36 AM, Oscar Benjamin
<oscar.j.benjamin at gmail.com> wrote:
> On 11 October 2012 14:18, Chris Angelico <rosuav at gmail.com> wrote:
>> Not propagating across function calls strikes me as messy, but I see
>> why you'd want it. Would this be better as a __future__ directive?
>> There's already the concept that they apply to a module but not to
>> what that module calls.
>
> __future__ directives are for situations in which the default
> behaviour will be changed in the future but you want to get the new
> behaviour now. The proposal is to always have widely supported,
> convenient ways to switch between different handling modes for
> numerical operations. The default Python behaviour would be unchanged
> by this.

Sure, it's not perfect for __future__ either, but it does seem odd for
a function invocation to suddenly change semantics. This change
"feels" to me more like a try/catch block - it's a change to this code
that causes different behaviour around error conditions. That ought to
continue into a called function.

ChrisA



More information about the Python-ideas mailing list