disallow_untyped_calls in module does not override global section · Issue #10757 · python/mypy · GitHub
Skip to content

disallow_untyped_calls in module does not override global section #10757

Description

@icepython

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:)

  1. 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])
  1. 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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugmypy got something wrongtopic-configurationConfiguration files and flags

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions