On this page
  1. decimal.Overflow
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

decimal.Overflow

Prev: decimal.localcontext | Up: decimal | Next: decimal.Rounded
Rel: decimal.Clamped, decimal.Context, decimal.ConversionSyntax, decimal.Decimal
Ref: docs.python.org โ€” decimal.Overflow
Tags: #public #python3 #stdlib #decimal


Import

import decimal
from decimal import Overflow

Signature & Overview

decimal.Overflow(...)

decimal.Overflow class.

Methods & Attributes

Usage

from decimal import Decimal, Overflow, localcontext

with localcontext() as ctx:
    ctx.Emax = 5
    try:
        _ = Decimal("1e5") * Decimal("10")
    except Overflow:
        assert True

Gotchas

REPL Inspect

from decimal import Overflow
help(Overflow)

Linked from

Related notes