-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongtopic-type-narrowingConditional type narrowing / binderConditional type narrowing / binder
Description
Bug Report
Consider the following: https://mypy-play.net/?mypy=master&python=3.12&gist=dbad46bbd0f39d316a2e82262ceeb4fa
In 1.16, this code raises an error at the first return after the None check, Incompatible return value type (got "None", expected "T"), though it was fine in 1.15
Your Environment
- Mypy version used: 1.16
- Mypy command-line flags: stock
- Mypy configuration options from
mypy.ini(and other config files): n/a - Python version used: 3.11, 3.12
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-type-narrowingConditional type narrowing / binderConditional type narrowing / binder