disallow_untyped_calls in module does not override global section · Issue #10757 · python/mypy (original) (raw)
Bug Report
Since updating numpy from version "1.20.3" to version "1.21.0" we are getting the following errors:
error: Call to untyped function "load" in typed context
We want to suppress errors about untyped calls from numpy - but not globally.
To Reproduce
(Write your steps here:)
- files
mypy.ini
:
[mypy]
disallow_untyped_calls = True
[mypy-numpy.*]
disallow_untyped_calls = False
example.py
:
import numpy as np
def fun() -> None:
np.save("path", [1, 2])
- Call with:
mypy example.py --config-file mypy.ini
Expected Behavior
Expected to not see an error about: Call to untyped function
Actual Behavior
Actual: example.py:5: error: Call to untyped function "save" in typed context
Your Environment
- Mypy version used:
mypy 0.812
- Mypy command-line flags:
--config-file mypy.ini
- Mypy configuration options from
mypy.ini
(and other config files): - Python version used:
Python 3.8.10
- Operating system and version:
Ubuntu 20.04.2 LTS
- Numpy version:
1.21.0
Note: setting disallow_untyped_calls
to False globally does work (but is undesired)