#4428·mlx

[ENH]: Using `IndexError` instead of `ValueError` at appropriate places?

Author: prady0tCreated Aug 29, 2026Updated Sep 10, 2026
Labelsenhancementlow prioritypython

☑️ I understand it is strictly prohibited to use AI to write issues.

Following the suggestion, functions like expand_dims raise ValueError when the axis is invalid, but it makes more sense for them to raise IndexError instead.