Skip to content

0.2.0

Latest

Choose a tag to compare

@yasserfedsi yasserfedsi released this 01 Feb 20:29
· 17 commits to main since this release

Breaking Changes

  • Replaced the function-based API with a class-based API.
  • Arithmetic operations (add, subtract, multiply, divide) are now instance methods of the Calculator class.
  • Removed top-level function exports from the public API.

Added

  • Introduced the Calculator class as the primary public interface.
  • Automatic input coercion:
    • Supports int, float, and numeric str values.
    • Inputs are converted internally without requiring explicit casting.
  • Centralized input validation using internal utility modules.

Improved

  • Consistent and explicit error handling:
    • Raises TypeError for invalid numeric inputs.
    • Raises ValueError for division by zero.
  • Improved internal project structure to support future extensibility.
  • Updated test suite to reflect the new class-based design.

Internal

  • Added internal utils.convert_to_num helper for numeric normalization.
  • Clarified public API boundaries by limiting exports to supported interfaces.

Migration Guide

Before (v0.1.x):

from mathlib import add
add(2, 3)

After (v0.2.0):

from mathlib import Calculator

calc = Calculator()
calc.add(2, 3)