style: add module docstring and __all__ to calculator
This commit is contained in:
@@ -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:
|
||||
if op in ("/", "//") and b == 0:
|
||||
raise ZeroDivisionError("division by zero")
|
||||
|
||||
Reference in New Issue
Block a user