Alex Waygood
Alex Waygood
[Mypy](https://mypy-play.net/?mypy=latest&python=3.12&gist=2cc45538a0bb162f1f4ecd996515d985), [pyright](https://pyright-play.net/?pyrightVersion=1.1.405&pythonVersion=3.13&reportUnreachable=true&code=GYJw9gtgBAhgRgYygSwgBzCALrOBnLEGBLCAUywAswATAKDoQBsY88oAxALjqj6gAC8AkRLkqtXvxplgUcdRoAKPGSbAAlFAC0APhQA7LFygA6cw2at2AcSUcNPflBlyFtFWs079yI0%2Bd%2BEAoAVxADKDwQtDIQJQ1Td2UNOiA) and [pyrefly](https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeS4ATrgLYAEq2AxnRDcbpQC4PZxeVUTLjRhcAFrkwAddLKZRUcOHQBiiWXS10AAo36DhoiVM3bMMMHWOTMACjgwoYAJR0AtAD5W6LojqEgbLyisp0AOJ2qi4a6Np0FlY2Ug5Orh7eEL6x8fGUYgCulHFwBcQwlHYuhMn2LiAANCAFXNBwJOSIIADEdACqrVAQXKR0YAXowhC46HDBWJZjnDSoXAD66AU02BV2%2BP5ZXG5edAY52vlcRXFg0iAAcls7lP7A%2BAC%2Bd7KNIGT5YFBSIQuLQoBRegAFUj-QGnDA4Ah0JgzSAAcyKq2m6EIsl6AGUYDA6OIuFxiHBEAB6Sl-SyAwicVGUmDoSmYXBMOCU5HoNEY1ozSlLSgMABuqGgjFgSJREHRggFcVwxEV7VkZBM6HcooqcCxdAAvHQ7gBmQgARgATF90CB3k0hK0dapoDAKGgsHgiGQ7UA) all detect the unsoundness here. We should too: ```py from abc import abstractmethod class F: @abstractmethod def method(self) -> int: ... class G(F): def method(self) ->...
A PR that only touches code in that crate should never have any impact on memory usage or diagnostics produced. And the comments from the bot just lead to additional...
```py from typing import Sequence class C: ... def f(x: Sequence[int]): if isinstance(x, C): reveal_type(x[0]) # revealed: @Todo ``` We should infer `int` there (and, same as our current behaviour,...
`(1, *(2, 3), 4)` should be inferred as `tuple[Literal[1], Literal[2], Literal[3], Literal[4]]`, but we currentluy infer it as `tuple[Literal[1], @Todo(StarredExpression), Literal[4]]`.
### Summary ty currently emits no error on the following code, but it should: ```py class Foo[T]: ... def requires_type(x: type): ... requires_type(Foo[int]) ``` `Foo[int]` here is not an instance...
When displaying a union (e.g. in error messages or on hover), it would be nicer if we displayed the union `type[A] | type[B] | type[C]` as `type[A | B |...
Our rule enforcing the Liskov Substitution Principle on method overrides (currently called `invalid-method-override`) is currently much stricter than any other type checker's equivalent rule. We should split the more pedantic...
### Summary Opening an issue so I don't forget about this TODO: https://github.com/astral-sh/ruff/blob/e177cc2a5a5d5e25c06ea6b0bbac9209f37fe756/crates/ty_python_semantic/resources/mdtest/named_tuple.md?plain=1#L623-L631. The bug can probably also be reproduced for some of our other override-related rules such as `invalid-method-override`....
For some of our rules there isn't a 1:1 mapping, but for a lot of rules there is. This could be really helpful for users migrating from other type checkers....
## Summary Currently this snapshot feels like it causes quite a lot of development pain (at least for me), because I never think to run the `ty_server` tests if all...