On this page
decimal.DivisionByZero
Prev: decimal.DecimalTuple | Up: decimal | Next: decimal.DivisionImpossible
Rel: decimal.Clamped, decimal.Context, decimal.ConversionSyntax, decimal.Decimal
Ref: docs.python.org โ decimal.DivisionByZero
Tags: #public #python3 #stdlib #decimal
Import
import decimal
from decimal import DivisionByZero
Signature & Overview
decimal.DivisionByZero(...)
decimal.DivisionByZero class.
Methods & Attributes
DivisionByZero.add_note(self, note, /)โ Add a note to the exceptionDivisionByZero.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
from decimal import Decimal, DivisionByZero
try:
Decimal("1") / Decimal("0")
except DivisionByZero:
assert issubclass(DivisionByZero, ZeroDivisionError)
Gotchas
- Subclass of both
DecimalExceptionand built-inZeroDivisionError.
REPL Inspect
from decimal import DivisionByZero
help(DivisionByZero)
Linked from
Related notes
- tuts/python3/stdlib_module/decimal/DecimalTuple Linked here; links to this page; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/DivisionImpossible 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/DivisionUndefined shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/FloatOperation shared tags: #decimal, #stdlib