Skip to content

dmypy suggest --no-any still gives suggestion with Any #18939

Open
@asottile-sentry

Description

@asottile-sentry

Bug Report

I expect --no-any to forbid Any... however...

To Reproduce

def f(x):
    if not isinstance(x, dict):
        raise AssertionError
    return x
[mypy]
check_untyped_defs = true

Expected Behavior

$ dmypy run .
...
$ dmypy suggest t.f --no-any
No guesses that match criteria!

Actual Behavior

$ dmypy suggest t.f --no-any
(object) -> typing.Dict[Any, Any]

Your Environment

  • Mypy version used: 1.15.0
  • Mypy command-line flags: see above
  • Mypy configuration options from mypy.ini (and other config files): see above
  • Python version used: 3.13.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions