Skip to content

Mypy skips function-level ignore comments on nested functions #10001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bharel opened this issue Feb 1, 2021 · 1 comment
Closed

Mypy skips function-level ignore comments on nested functions #10001

bharel opened this issue Feb 1, 2021 · 1 comment
Labels
bug mypy got something wrong

Comments

@bharel
Copy link

bharel commented Feb 1, 2021

Bug Report

Mypy skips #type: ignore on nested functions and applies them only to the function line.

image

To Reproduce

  1. Create a nested function.
  2. Add a type: ignore comment on the function.
  3. Create a type error inside your nested function.

Your Environment

  • Mypy version used: 0.800
  • Mypy command-line flags: --disallow-untyped-defs, --show-column-numbers, --follow-imports=silent, --ignore-missing-imports, --check-untyped-defs
  • Mypy configuration options from mypy.ini (and other config files): Nope
  • Python version used: 3.9.0
  • Operating system and version: Windows 10
@bharel bharel added the bug mypy got something wrong label Feb 1, 2021
@bharel
Copy link
Author

bharel commented Feb 1, 2021

My bad, covered by #6948.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

1 participant