python-fire icon indicating copy to clipboard operation
python-fire copied to clipboard

Add calculator_tools example (add, subtract, multiply, divide)

Open NA-V10 opened this issue 3 months ago • 0 comments

Summary

This PR adds a new example module calculator_tools to the examples/ directory. The design follows the exact structure and style of the existing cipher example, including licensing headers, CLI behavior, and test format.

Details

  • New folder: examples/calculator_tools/
  • Exposes simple arithmetic functions: add, subtract, multiply, divide
  • Uses Fire without specifying a component (same as cipher.py)
  • Proper Google-style docstrings and licensing header
  • Includes a full test suite with testutils.BaseTestCase
  • Tests cover basic arithmetic operations and division-by-zero error case

Checklist

  • [x] Code runs successfully
  • [x] Added test file following Google Fire conventions
  • [x] Example follows exact layout and style of existing examples
  • [x] No changes to core Fire library
  • [x] CLA signed

NA-V10 avatar Nov 23 '25 03:11 NA-V10