Live data from Hacker News

Announcing the Beta release of ty

astral.sh

101–110 of 181 posts

Re: Announcing the Beta release of ty

#101
post #28
post #6

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.

I think it is way to slow too. The one from microsoft (pylance IIRC) is better in my opinion.

Re: Announcing the Beta release of ty

#103

Earlier 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.

https://github.com/microsoft/pyright/blob/main/docs/type-inf...

Re: Announcing the Beta release of ty

#105

Earlier 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.

Not sure where the AI generated python is coming from?

AI generated anything is a hellscape.

Re: Announcing the Beta release of ty

#106
post #22

I 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?

I am not that surprised, to be honest. Basically every C/C++ static analyzer out there does (among other things) some amount of additional "custom" type checking to catch operations that are legal up to the standard, but may cause issues at runtime. Of course in Python you have gradual typing which adds to the complexity, but truly well-formalised type systems are not that common in the industry.

Re: Announcing the Beta release of ty

#107
post #90

Earlier 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)

Thank you!

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

#109
Jesus, how long will we need this shite? Can't someone from MS fix this already? Or is it possible for Astral to implement fully fledged Python extension so you don't have to use Microsoft crap that includes proprietary pylance?

``` 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

#110
post #45

Is there any study that shows that typing in Python improves code quality and reduce runtime issues?

> Ughm, is there any study that shows that guardrails and lights on bridges reduce fatalities?

> Akshually, are there any studies showing that cars riding 30 km/h kill less people than cars that ride 80 km/h?

Post reply on HN