Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

mypy infers Any for numpy 2.2.2. expressions that worked with 2.2.1 #18496

Copy link
Copy link
Open
@bersbersbers

Description

@bersbersbers
Issue body actions

Bug Report

mypy infers Any for several numpy expressions after upgrading to numpy==2.2.2

See also

To Reproduce

from typing import reveal_type

import numpy as np

reveal_type(np.maximum(np.array(1), np.array(1)))

Expected Behavior

ndarray[tuple[int, ...], dtype[Any]]

Actual Behavior

Any

Your Environment

This works with numpy==2.2.1; also, it works with pyright. So it seems to be specific to numpy==2.2.2 and mypy.

  • Mypy version used: mypy 1.14.1 (compiled: yes)
  • Mypy command-line flags: none
  • Mypy configuration options from mypy.ini (and other config files): none
  • Python version used: 3.13.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.