[Python-Dev] Strategy for converting the decimal module to C

Giovanni Bajo rasky at develer.com
Wed Jul 19 02:34:28 CEST 2006


Tim Peters wrote:

> Changing the user-visible API is a hard egg to
> swallow, and it's unfortunate that the Python code used a dict to hold
> "flags" to begin with.  The dict doesn't just record whether an
> exception has occurred, it also counts how many times the exception
> occurred.  It's possible that someone, somewhere, has latched on to
> that as "a feature".

Especially since it was a documented one:

>>> import decimal
>>> help(decimal.Context)
Help on class Context in module decimal:

class Context(__builtin__.object)
 |  Contains the context for a Decimal instance.
[...]
 |  flags  - When an exception is caused, flags[exception] is incremented.
 |           (Whether or not the trap_enabler is set)
 |           Should be reset by user of Decimal instance.
[...]

-- 
Giovanni Bajo


More information about the Python-Dev mailing list