[Python-Dev] Mixing float and Decimal -- thread reboot

Stefan Krah stefan at bytereef.org
Wed Mar 24 20:36:13 CET 2010


Nick Coghlan <ncoghlan at gmail.com> wrote:
> Raymond Hettinger wrote:
> > The decimal module is already drowning in complexity,
> > so it would be best to keep it simple:  one boolean flag
> > that if set would warn about any implicit decimal/float
> > interaction.
> 
> Agreed - those that want exceptions instead can use the usual warnings
> module mechanisms to trigger them.


I'm not sure about the warnings module. If lower complexity is a goal,
I would prefer Facundo's original proposal of just adding a single new
signal. Users who just want to know if a NonIntegerConversion has occurred
can check the flags, users who want an exception set the trap.

With the warnings module, users have to know (and deal with) two exception
handling/suppressing mechanisms.


Stefan Krah




More information about the Python-Dev mailing list