Skip to content

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

Closed

Description

@JelleZijlstra

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.

Activity

  1. changed the title [-]Passing `--disallow-any=generics` breaks `--disallow-untyped-defs`[/-] [+]Setting `disallow_any = generics` in mypy.ini breaks `disallow_untyped_defs = True`[/+] on Oct 8, 2017
  2. self-assigned this
    on Oct 9, 2017
  3. JelleZijlstra commented on Oct 9, 2017

    @JelleZijlstra
    MemberAuthor

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

  4. added a commit that references this issue on Oct 13, 2017
    47e53f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions