Re:Pyrefly vs. Ty: Comparing Python's Two New Rust-Based Typ...
by josevalim on Wednesday May 28, 2025 @05:06PM
(#44120659)
For us type inference is the same as type checking where all parameters are given the dynamic type. So even if you explicitly added a signature that said dynamic, we would still find a violation, where others would not. The point is that dynamic does not have to mean “anything goes”.
If the body of the function contained only the first or the second call, the verdict would have been that x is respectively an Integer or an Atom and the type of the function is the type of the contained expression.