decimal.Context.add()

add(x, y) Return the sum of x and y.

decimal.Context

class decimal.Context(prec=None, rounding=None, Emin=None, Emax=None, capitals=None, clamp=None, flags=None, traps=None) Creates a new context. If a field is not specified or is None, the default values are copied from the DefaultContext. If the flags field is not specified or is None, all flags are cleared. prec is an integer in the range [1, MAX_PREC] that sets the precision for arithmetic operations in the context. The rounding option is one of the constants listed in the section Rounding

decimal.Context.canonical()

canonical(x) Returns the same Decimal object x.

decimal.Context.clear_flags()

clear_flags() Resets all of the flags to 0.

decimal.BasicContext

class decimal.BasicContext This is a standard context defined by the General Decimal Arithmetic Specification. Precision is set to nine. Rounding is set to ROUND_HALF_UP. All flags are cleared. All traps are enabled (treated as exceptions) except Inexact, Rounded, and Subnormal. Because many of the traps are enabled, this context is useful for debugging.

decimal.Clamped

class decimal.Clamped Altered an exponent to fit representation constraints. Typically, clamping occurs when an exponent falls outside the context’s Emin and Emax limits. If possible, the exponent is reduced to fit by adding zeros to the coefficient.

dbm.whichdb()

dbm.whichdb(filename) This function attempts to guess which of the several simple database modules available — dbm.gnu, dbm.ndbm or dbm.dumb — should be used to open a given file. Returns one of the following values: None if the file can’t be opened because it’s unreadable or doesn’t exist; the empty string ('') if the file’s format can’t be guessed; or a string containing the required module name, such as 'dbm.ndbm' or 'dbm.gnu'.

dbm.open()

dbm.open(file, flag='r', mode=0o666) Open the database file file and return a corresponding object. If the database file already exists, the whichdb() function is used to determine its type and the appropriate module is used; if it does not exist, the first module listed above that can be imported is used. The optional flag argument can be: Value Meaning 'r' Open existing database for reading only (default) 'w' Open existing database for reading and writing 'c' Open database for reading and

dbm.ndbm.library

dbm.ndbm.library Name of the ndbm implementation library used.

dbm.ndbm.error

exception dbm.ndbm.error Raised on dbm.ndbm-specific errors, such as I/O errors. KeyError is raised for general mapping errors like specifying an incorrect key.