diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fbfc223415..a68228bb17 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,14 +55,15 @@ repos: - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.13.0 # check the oldest and newest supported Pythons + # except skip python 3.9 for numpy, due to poor typing hooks: - &mypy id: mypy - name: mypy with Python 3.9 + name: mypy with Python 3.10 files: src additional_dependencies: ['numpy', 'types-tqdm', 'click', 'types-jsonpatch', 'types-pyyaml', 'types-jsonschema', 'importlib_metadata', 'packaging'] - args: ["--python-version=3.9"] + args: ["--python-version=3.10"] - <<: *mypy name: mypy with Python 3.12 args: ["--python-version=3.12"] diff --git a/src/pyhf/tensor/numpy_backend.py b/src/pyhf/tensor/numpy_backend.py index 423d54c152..677434cab5 100644 --- a/src/pyhf/tensor/numpy_backend.py +++ b/src/pyhf/tensor/numpy_backend.py @@ -203,8 +203,7 @@ def tolist( self, tensor_in: Tensor[T] | list[T] ) -> int | float | complex | list[T] | list[Any]: try: - # unused-ignore for [no-any-return] in python 3.9 - return tensor_in.tolist() # type: ignore[union-attr,no-any-return,unused-ignore] + return tensor_in.tolist() # type: ignore[union-attr] except AttributeError: if isinstance(tensor_in, list): return tensor_in