Announcing the Beta release of ty

(astral.sh)

221 points | by gavide 3 hours ago

20 comments

  • frou_dh 2 hours ago
    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 particularly verbose form compared to what I'm used to - maybe they're technically correct but it can be bit much to look at.

    Anyway, odds are pretty good that ty is what I will end up using long-term, so thanks and congrats on releasing the first beta!

    • hauntsaninja 33 minutes ago
      Note: while spec conformance is important, I don't recommend using it as the basis for choosing a type checker. It is not representative of the things that most users actually care about (and is not meant to be).

      (I was on the Python Typing Council and helped put together the spec, the conformance test suite, etc)

    • _carljm 2 hours ago
      We'll be adding ourselves to that table soon. We'll have some work to catch up with pyright on conformance, but that's what the time between now and stable release is for.
    • progbits 1 hour ago
      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.

    • WD-42 1 hour ago
      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.
    • IshKebab 1 hour ago
      Pyright is really really good. Anyone that doubts that 10x engineers exist, just go and look at Eric Traut. He's pretty much written it single handedly. Absolute machine.

      Mypy is trash. Nice to have a table to point to to prove it.

      • buibuibui 1 hour ago
        Oh my, I just looked him up. He is the developer of Virtual Game Station - a PS1 emulator that I used in the past to play PS Isos on my Windows ME PC! What a legend.
  • numbers 0 minutes ago
    is there anything like `uv` available for ruby? going from python and typescript where I can use uv and bun, it feels like ruby is stuck in the past :(
  • shrumm 1 hour ago
    Thanks Astral team! We use Pydantic heavily, and it looks like first class support from Ty is slated for the stable release, we'd love to try it.

    While we wait... what's everyone's type checking setup? We run both Pyright and Mypy... they catch different errors so we've kept both, but it feels redundant.

    https://htmlpreview.github.io/?https://github.com/python/typ... suggests that Pyright is a superset, which hasn't matched our experience.

    Though our analysis was ~2 years ago. Anyone with a large Python codebase successfully consolidated to just Pyright?

    • hauntsaninja 28 minutes ago
      Mentioned this in another comment, but the spec conformance suite is not representative of the things users care about (nor is it meant to be).

      The spec mostly concerns itself with the semantics of annotations, not diagnostics or inference. I don't really recommend using it as the basis for choosing a type checker.

      (I was on the Python Typing Council and helped put together the spec, the conformance test suite, etc)

  • klysm 1 hour ago
    I really hope astral can monetize without a highly destructive rugpull, because they are building great tools and solving real problems.
    • amanzi 6 minutes ago
      "pyx" is their first commercial offering: https://astral.sh/pyx

      I agree though. Hope this is successful and they keep building awesome open-source tools.

    • tabbott 1 hour ago
      Yeah their work thus far has been an incredible public service to the Python community.
  • sails01 1 minute ago
    Is there any study that shows that typing in Python improves code quality and reduce runtime issues?
  • collinmcnulty 50 minutes ago
    I am so pleased by ty’s stance that I should not have to add annotations to satisfy the type checker. I ripped out last type checker out because it was constantly nagging us about technicalities, but ty immediately found issues where we annotated that a duct was an acceptable input, but actually doing so would break things.
  • modeless 2 hours ago
    The title of this story should be "Announcing the Beta release of ty". A lot of people have been waiting for the beta specifically.

    I've been using Pyrefly and loving it compared to Pyright, but they recently shipped some updates with crash bugs that forced me to pin to a previous version, which is annoying. Unfortunately my first impression of ty isn't great either. Trying to install the ty extension on the current version of Cursor says "Can't install 'astral-sh.ty' extension because it is not compatible with the current version of Cursor (version 2.2.20, VSCode version 1.105.1)."

    • ocamoss 43 minutes ago
      (pyrefly maintainer here) If you haven't already, please file an issue for that crash on the [Pyrefly repo](https://github.com/facebook/pyrefly) as well :)
    • charliermarsh 2 hours ago
      If there's anything else accompanying the error, do you mind filing an issue? I've been using the ty extension with Cursor for weeks and am having trouble reproducing right now.
      • modeless 2 hours ago
        That's the full error. It shows up in a dialog box when I press the install button. I'm on macOS, connected with the Anysphere Remote SSH extension to a Linux machine.

        If I choose "install previous version" I am able to install the pre-release version from 12 hours ago without issue. Then on the extension page I get a button labeled "Switch to Release Version" and when I press it I get an error that says "Can't install release version of 'ty' extension because it has no release version." Filed a GitHub issue with these details.

        In the meantime, the previous version appears to be working well! I like that it worked without any configuration. The Pyrefly extension needed a config tweak to work.

        • _carljm 1 hour ago
          https://forum.cursor.com/t/newly-published-extensions-appear... suggests that there's some kind of delayed daily update for new VSCode extension versions to become available to Cursor? It seems likely that's what is happening here, since ty-vscode 0.0.2 was only published an hour or two ago.
          • modeless 1 hour ago
            Oh, huh, and since there's no previous release version it just fails to install completely? That's unfortunate.
        • _carljm 1 hour ago
          I can reproduce this; we're looking into it.
  • pansa2 1 hour ago
    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?

    • WD-42 1 hour ago
      You’re talking about a duck typed language with optional type annotations. I love python but that’s a combination that should explain a bit why there are so many different implementations.
    • mirashii 1 hour ago
      > Do library authors have to test against every type checker to ensure maximum compatibility?

      Yes, but in practice, the ecosystem mostly tests against mypy. pyright has been making some inroads, mostly because it backs the diagnostics of the default VS Code Python extension.

      > Do application developers need to limit their use of libraries to ones that support their particular choice of type checker?

      You can provide your own type stubs instead of using the library's built-in types or existing stubs.

  • Ch00k 2 hours ago
    That's great news! TIL that ty is also a language server, which means it replaces not only mypy, but also Pyright in Neovim/VSCode.
  • akdor1154 47 minutes ago
    Wow, even if it wasn't so fast, I'd be tempted to use this solely due to their support of intersection (A & B) types! This is a sore omission from the standard python typing system.
  • 0cf8612b2e1e 1 hour ago
    Without digging too deep- what is the Django story?

    Django does a bunch of magic which is challenging for the type checkers to handle well.

    • selcuka 1 hour ago
      Ty doesn't support Django yet, and it doesn't have a plugin system, so third party developers can't improve it. If you need Django support, it is better to stick to mypy or pyright for the time being.
  • tabbott 1 hour ago
    Very exciting! I guess I'll have to wait for Django and Pydantic support to migrate to it on Zulip, but type checking was the last major linter that's still slow in Python.
  • f311a 1 hour ago
    Too bad they did not benchmark Zuban, which is also promising.

    Also, it's also too bad we have three competing fast LSP/typechecker projects now We had zero 1 year ago.

    • iamdanieljohns 1 hour ago
      The guy behind Zuban should've put his project out the in open way earlier. I'd love to see both projects succeed, but in reality it should become one.
  • Svoka 1 hour ago
    Very excited to see this. I thought that speed does not matter much for python tooling, but then I tried uv, and realized that I was wrong. The experience is just better. Looking forward to see more high performance quality tooling for Python.
  • maxloh 2 hours ago
    How conformant is this, compared to e.g. mypy?
  • fkarg 1 hour ago
    well, this is where being pedantic bites me in the a* again. Our codebase has been mostly pyright-focused, with many very specific `pyright: ignore[...]` pragmas. Now it would be great if ty (pyrefly has an option!) could also ignore those lines. There's not _that_ many of them, but .... it's a pain.
  • Zababa 1 hour ago
    Beautiful acknowledgment list, and congratulations on the beta release!
  • hexo 31 minutes ago
    rust again? ill skip
  • almanael 1 hour ago
    Not impressed because when tried ruff, and discovered that it doesn't replace (basic) pylint check https://github.com/astral-sh/ruff/issues/970 so we have ruff then pylint (and looking at the number of awaiting PR of ruff feels bad)
    • zanie 1 hour ago
      As noted in the linked issue

      > At time of writing, many of the remaining rules require type inference and/or multi-file analysis, and aren't ready to be implemented in Ruff.

      ty is actually a big step in this direction as it provides multi-file analysis and type inference.

      (I work at Astral)

  • syiblet 1 hour ago
    The codebase has none of the rust code. In fact even the python code in the code base is mostly just scripts for updating version tags and etc...

    Seems like the code isn't actually open source which to me is a bit concerning. At the very least, if ya'll want to release it like this please be clear that you're not open source. The MIT license in the repo gives the wrong impression.