style: add module docstring and __all__ to calculator

This commit is contained in:
Andrew Emelyaneko
2026-09-28 13:34:47 +03:00
parent d7701ecee6
commit 6cc3455b06
+9
View File
@@ -1,3 +1,12 @@
"""A small arithmetic calculator.
Provides the :func:`calculate` function which performs basic arithmetic
operations (+, -, *, /, **, //) with proper error handling.
"""
__all__ = ["calculate"]
def _check_div_zero(b: float | int, op: str) -> None: def _check_div_zero(b: float | int, op: str) -> None:
if op in ("/", "//") and b == 0: if op in ("/", "//") and b == 0:
raise ZeroDivisionError("division by zero") raise ZeroDivisionError("division by zero")