David Peter
David Peter
FWIW, I think we should prioritize this. [2,471 new diagnostics](https://github.com/astral-sh/ruff/pull/20523#issuecomment-3325399343) is a massive amount. That averages to 17 new diagnostics per ecosystem project. They are obviously not evenly distributed, but...
Instead of falling back to `Unknown`, we could potentially return [`AnyOf[ValueType1, ValueType2, …]`](https://github.com/python/typing/issues/566)? This is similarly forgiving to `Unknown`, but would allow us to use auto-completions when typing e.g. `state["name"].lo`....
Where ty's current behavior definitely differs from mypy, pyrefly is when you explicitly annotate with `dict[str, Any]` in an attempt to get rid of these errors. Because we always prefer...
With the latest changes in https://github.com/astral-sh/ruff/pull/20927, my last comment here is not relevant anymore. So I will move this from Beta to GA. Feel free to move it back if...
Thank you for reporting this. Do you know how other type-checkers handle this situation (if they have support for notebooks)? Is there a stub file available somewhere that would list...
> It's missing the `match` pattern definition types in infer, but I'm not seeing how we are able to set up an expression there using infer_expression_types. The code comment https://github.com/astral-sh/ruff/blob/0d7ed32494df58f62ed6b48a3491f258ca7fd086/crates/ty_python_semantic/src/types/infer.rs#L3664...
Thank you for reporting this. That is a bug. The union `float | int` comes from [this special case](https://docs.astral.sh/ty/reference/typing-faq/#why-does-ty-show-int-float-when-i-annotate-something-as-float), but we should not error on the multiplication in the function...
Adding a note here that we have an existing test for this with a TODO: https://github.com/astral-sh/ruff/blob/e177cc2a5a5d5e25c06ea6b0bbac9209f37fe756/crates/ty_python_semantic/resources/mdtest/generics/pep695/functions.md?plain=1#L241-L261
Not exactly what you want, but something that you can use as a workaround in the meantime: The [`ecosystem-analyzer`](https://github.com/astral-sh/ecosystem-analyzer/) program can parse ty's "concise" diagnostic output. You can use the...
Thank you for reporting this. > The root cause seems to be `torch.nn.Module`'s custom `__setattr__` implementation, which claims that it only accepts `Union[Tensor, "Module"]`, but in reality forwards any other...