On this page
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
Overflow.add_note(self, note, /)โ Add a note to the exceptionOverflow.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
from decimal import Decimal, Overflow, localcontext
with localcontext() as ctx:
ctx.Emax = 5
try:
_ = Decimal("1e5") * Decimal("10")
except Overflow:
assert True
Gotchas
- Trapped by default: Raised when an exponent exceeds
ctx.Emax.
REPL Inspect
from decimal import Overflow
help(Overflow)
Linked from
Related notes
- tuts/python3/stdlib_module/decimal/localcontext Linked here; links to this page; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/Rounded Linked here; links to this page; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/Clamped Linked here; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/Context Linked here; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/ConversionSyntax Linked here; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/Decimal Linked here; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/decimal/DecimalException shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/DecimalTuple shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/DivisionByZero shared tags: #decimal, #stdlib