Skip to content

assert_type() says an int is not an int #12923

@jwodder

Description

@jwodder

The following code:

from typing_extensions import assert_type

assert_type(42, int)

fails to typecheck with the following message:

assert-type01.py:3: error: Expression is of type "int", not "int"

Your Environment

  • Mypy version used: both 0.960 and commit 1636a05
  • Mypy command-line flags: none
  • Mypy configuration options from mypy.ini (and other config files): none
  • Python version used: 3.9.13
  • Operating system and version: macOS 11.6.6

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions