-
-
Notifications
You must be signed in to change notification settings - Fork 49k
Description
Repository commit
Python version (python --version)
Python 3.10.7
Dependencies version (pip freeze)
Not applicable (this is a logical issue, not dependency-related)
Expected behavior
All methods (compress, decompress, and coordinate_map) should handle missing or invalid values consistently.
Either:
All methods raise exceptions (e.g., KeyError, ValueError) for invalid inputs, or
All methods return a defined sentinel value (e.g., -1 or None) to indicate failure.
The chosen behavior should be clearly documented and predictable.
There should be no mix of silent failures and exceptions.
Actual behavior
he methods currently behave inconsistently when given invalid or missing inputs:
compress(80) → returns -1 (silent failure)
coordinate_map[80] → raises KeyError (exception)
decompress(5) → returns -1 (silent failure)
This inconsistent mix of return values and exceptions makes debugging difficult and can lead to unexpected runtime behavior.