Re:Python Type Checker Comparison: Empty Container Inference
by Sinidir on Sunday March 01, 2026 @04:47PM
(#47211027)
In the example given in the article i think the correct behavior would have been to infer the type backwards from the return type of the function. Is that not why mypy actually errors here?
[ Parent
| on HN ]
Re:Python Type Checker Comparison: Empty Container Inference
by ocamoss on Sunday March 01, 2026 @06:21PM
(#47211886)
If you're referring to the `first_three_lines` example in strategy 3, Mypy would give the same error even if we changed the return value to something unrelated like `return ["something"]`.