thebeat icon indicating copy to clipboard operation
thebeat copied to clipboard

Better type checking using the numbers module

Open Jellevanderwerff opened this issue 1 year ago • 2 comments

Sometimes input validation is done using e.g. isinstance(input, (int, float, np.float64)) etc. Better change this to use the numbers module, e.g. isinstance(input, Integral)

Jellevanderwerff avatar Jul 14 '23 10:07 Jellevanderwerff

Should be numbers.Real, to cover float and not just int

YannickJadoul avatar Jul 14 '23 11:07 YannickJadoul

Let's reconsider this once we consider integrating mypy

Jellevanderwerff avatar Nov 16 '23 16:11 Jellevanderwerff