Skip to content

Conversation

@ilevkivskyi
Copy link
Member

Fixes #19184

This fixes an (edge-case) regression introduced in 1.16. Fix is straightforward, only ignore __call__ if it comes from an actual metaclass.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2025

Diff from mypy_primer, showing the effect of this PR on open source code:

nox (https://github.com/wntrblm/nox): 1.27x slower (25.1s -> 32.0s in single noisy sample)

typeshed-stats (https://github.com/AlexWaygood/typeshed-stats): 1.64x slower (57.9s -> 95.1s in single noisy sample)

materialize (https://github.com/MaterializeInc/materialize): 1.05x slower (134.2s -> 141.0s in single noisy sample)

scikit-build-core (https://github.com/scikit-build/scikit-build-core): 1.11x slower (42.7s -> 47.6s in single noisy sample)

discord.py (https://github.com/Rapptz/discord.py): 1.05x faster (306.2s -> 290.3s in single noisy sample)

@hauntsaninja hauntsaninja merged commit 5fbfff9 into python:master Jun 1, 2025
19 checks passed
@ilevkivskyi ilevkivskyi deleted the fix-proto-meta-any branch June 1, 2025 01:36
JukkaL pushed a commit that referenced this pull request Jun 11, 2025
Fixes #19184

This fixes an (edge-case) regression introduced in 1.16. Fix is
straightforward, only ignore `__call__` if it comes from an _actual_
metaclass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[1.16] Regression in inferring type via unittest.mock.Mock

2 participants