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

Allow dangerous identity comparisons to Any typed variables#21142

Merged
hauntsaninja merged 3 commits intopython:masterpython/mypy:masterfrom
hauntsaninja:strictequalsentinelhauntsaninja/mypy:strictequalsentinelCopy head branch name to clipboard
Apr 2, 2026
Merged

Allow dangerous identity comparisons to Any typed variables#21142
hauntsaninja merged 3 commits intopython:masterpython/mypy:masterfrom
hauntsaninja:strictequalsentinelhauntsaninja/mypy:strictequalsentinelCopy head branch name to clipboard

Conversation

@hauntsaninja
Copy link
Copy Markdown
Collaborator

Fixes #21134

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 1, 2026

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Copy Markdown
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH this is a hack, but I can't come up with anything better, so I guess this is fine as a quick fix.

@hauntsaninja hauntsaninja merged commit d7e3268 into python:master Apr 2, 2026
24 checks passed
@hauntsaninja hauntsaninja deleted the strictequalsentinel branch April 2, 2026 19:06
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.20 regression] Any is incorrectly narrowed after is comparison

2 participants

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