Hopefully it gets added to this comparison: https://htmlpreview.github.io/?https://github.com/python/typ... If that table is anything to go by, Pyright is not to be underestimated. I have briefly tried ty (LSP) in Emacs and it seems to work well so far. The only questionable thing I've encountered is that when the signature of a method is shown, the type annotations of some parameters seem to be presented in a partic…
Pyright has been great. But it’s slow. Speed of a LSP does matter for UX. Excited to see how much ty improves on this.
Announcing the Beta release of ty
101–110 of 181 posts
Re: Announcing the Beta release of ty
#102> RUFF 0.14.9
> UV 0.9.18
> TY 0.0.2
> PYX Beta
> GITHUB
Re: Announcing the Beta release of ty
#103Earlier quoted context omitted.
It doesn't. Either the optional type annotations have precise semantics or they don't.
What should a type checker say about this code? x = [] x.append(1) x[0] = "new" x[0] + "oops" It's optionally typed, but I would credit both "type checks correctly" and "can't assign 'new' over a number" as valid type checker results.
Re: Announcing the Beta release of ty
#104Is there any study that shows that typing in Python improves code quality and reduce runtime issues?
Re: Announcing the Beta release of ty
#105Earlier quoted context omitted.
pyright is very good, but there is also https://docs.basedpyright.com/latest/ which improves on it further. That said I'm very happy user of uv, so once Ty becomes ready enough will be happy to migrate.
Basedpyright plus any AI generated python is a hellscape unless you use hooks and have a lot of patience.
AI generated anything is a hellscape.
Re: Announcing the Beta release of ty
#106I still don’t understand how a single language can have multiple (what is it now, half a dozen?) different type checkers, all with different behaviour. Do library authors have to test against every type checker to ensure maximum compatibility? Do application developers need to limit their use of libraries to ones that support their particular choice of type checker?
Re: Announcing the Beta release of ty
#107Earlier quoted context omitted.
We should generally support TypeDicts. Can you go into more details of what is not working for you?
``` from anthropic.types import MessageParam data: list[MessageParam] = [{"role": "user", "content": [{"type": "text", "text": ""}]}] ``` This for example works both in mypy and pyright. (Also autocompletion of typedict keys / literals from pylance is missing)
I reported this as https://github.com/astral-sh/ty/issues/1994
Support for auto-completing TypedDict keys is tracked here: https://github.com/astral-sh/ty/issues/86
Re: Announcing the Beta release of ty
#108Re: Announcing the Beta release of ty
#109``` It's recommended to disable the language server from the Python extension to avoid running two Python language servers by adding the following setting to your settings.json:
{ "python.languageServer": "None" } ```
Re: Announcing the Beta release of ty
#110Is there any study that shows that typing in Python improves code quality and reduce runtime issues?
> Akshually, are there any studies showing that cars riding 30 km/h kill less people than cars that ride 80 km/h?