Skip to content
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

Setting disallow_any = generics in mypy.ini breaks disallow_untyped_defs = True #4075

Closed
JelleZijlstra opened this issue Oct 8, 2017 · 1 comment · Fixed by #4076
Closed
Assignees
Labels
bug mypy got something wrong priority-1-normal

Comments

@JelleZijlstra
Copy link
Member

I have the following code (rpc_server.py):

def get_tasks(self):
    return 'whatever'

And mypy.ini:

[mypy]
disallow_untyped_defs = True
disallow_any = generics

I would expect to get an error because get_tasks is missing an argument annotation and a return type annotation.

However, mypy --config-file /path/to/mypy.ini /path/to/rpc_server.py gives no errors. When I remove disallow_any = generics, I get the expected error. I also get the expected error if I simply do mypy --disallow-untyped-defs --disallow-any=generics—somehow it makes a difference that I use a config file.

@JelleZijlstra JelleZijlstra added bug mypy got something wrong priority-1-normal labels Oct 8, 2017
@JelleZijlstra JelleZijlstra changed the title Passing --disallow-any=generics breaks --disallow-untyped-defs Setting disallow_any = generics in mypy.ini breaks disallow_untyped_defs = True Oct 8, 2017
@JelleZijlstra JelleZijlstra self-assigned this Oct 9, 2017
@JelleZijlstra
Copy link
Member Author

I found the root cause and will submit a PR. A couple of untyped defs slipped into mypy itself because of this bug.

gvanrossum pushed a commit that referenced this issue Oct 13, 2017
…tion (#4076)

Fixes #4075.

There's a follow-up item to just get rid of `--disallow-any=unannotated` completely, but let's do that together with #4089.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong priority-1-normal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant