TE
ТехЭхо
ГлавнаяТоп за 24 часаНовейшиеЛучшиеВопросыПоказатьВакансии
GitHubTwitter
Главная

ТехЭхо

Платформа технологических новостей, созданная с использованием Next.js, предоставляющая глобальные технологические новости и обсуждения.

GitHubTwitter

Главная

ГлавнаяНовейшиеЛучшиеВопросыПоказатьВакансии

Ресурсы

HackerNews APIОригинальный HackerNewsNext.js

© 2025 ТехЭхо. Все права защищены.

Ty: A fast Python type checker and language server

849 балловавтор: arathore1 день назад

37 comments

zanie1 день назад
:wave:<p>Looks like you found the not-so-secret repository we&#x27;re using to prepare for a broader announcement :)<p>Please be aware this is pre-alpha software. The current version is 0.0.0a6 and the releases so far are all in service of validating our release process. We&#x27;re excited to get this in people&#x27;s hands, but want to set the expectation that we still have a lot of work left to do before this is production ready.<p>Stay tuned for more for news in the near future!<p>(... I work at Astral)
评论 #43919942 未加载
评论 #43919746 未加载
评论 #43923269 未加载
评论 #43919798 未加载
评论 #43919403 未加载
评论 #43924441 未加载
评论 #43920924 未加载
ngoldbaumоколо 24 часов назад
I gave away the “ty” project name on pypi to Astral a week or so ago. I wanted to use it for a joke a few years ago but this is a much better use for a two letter project name. They agreed to make a donation to the PSF to demonstrate their gratefulness.
评论 #43923073 未加载
评论 #43920403 未加载
评论 #43921777 未加载
评论 #43921877 未加载
评论 #43921873 未加载
评论 #43923856 未加载
aleksanb1 день назад
The way these type checkers get fast is usually by not supporting the crazy rich reality of realworld python code.<p>The reason we&#x27;re stuck on mypy at work is because it&#x27;s the only type checker that has a plugin for Django that properly manages to type check its crazy runtime generated methods.<p>I wish more python tooling took the TS approach of &quot;what&#x27;s in the wild IS the language&quot;, as opposed to a &quot;we only typecheck the constructs we think you SHOULD be using&quot;.
评论 #43919304 未加载
评论 #43919340 未加载
评论 #43919802 未加载
评论 #43926436 未加载
评论 #43919644 未加载
评论 #43923277 未加载
评论 #43919490 未加载
tmvphil1 день назад
Just compared the time to check on a fairly large project:<p>- mypy (warm cache) 18s<p>- ty: 0.5s (and found 3500 errors)<p>They&#x27;ve done it again.
评论 #43919324 未加载
评论 #43918779 未加载
评论 #43918924 未加载
评论 #43919184 未加载
hamandcheeseоколо 9 часов назад
Not the most fun question, but as I see Astral taking over the python ecosystem, I can&#x27;t help but wonder: how do y&#x27;all plan to make money? It seems like you&#x27;ve taken VC funding, so monetization is inevitable.
评论 #43929615 未加载
评论 #43925477 未加载
Handprint44691 день назад
If you have uv installed, you can test it without installing by running:<p><pre><code> uvx ty check</code></pre>
评论 #43919200 未加载
评论 #43919157 未加载
评论 #43920733 未加载
blibbleоколо 22 часов назад
prior to astral appearing, python&#x27;s tooling has been beyond terrible, compared to say, Java&#x27;s<p>astral have now replaced the awful pip with the fantastic uv<p>various awful linters with with the fantastic ruff<p>and now hopefully replacing the terrible type checkers (e.g. mypy) with a good one!<p>I hope they have the pypi backend on their list too, my kingdom for Maven Central in python!
评论 #43921214 未加载
评论 #43921347 未加载
评论 #43922660 未加载
评论 #43921087 未加载
评论 #43922002 未加载
rexledesma1 день назад
Very excited to have a new fully featured Python language server working in both vscode and vscode forks (e.g. Windsurf, Cursor).<p>Pylance is borked on these forked distributions, so having a new solid alternative here that doesn&#x27;t involve adopting yet another forked Pyright implementation (BasedPyright, Cursor Pyright, Windsurf Pyright, ...) sounds great to me.
评论 #43920152 未加载
krupan1 день назад
Have these guys figured out how to make money yet?
评论 #43919515 未加载
评论 #43920500 未加载
评论 #43920887 未加载
评论 #43923562 未加载
nickagliano1 день назад
Interesting to see astral come out with this right around facebook’s release of “Pyrefly, a faster Python type checker written in Rust”.<p>Not making any sort of ethical statement, just interesting that rust keeps eating the python and JS tooling worlds.
评论 #43919426 未加载
评论 #43919139 未加载
评论 #43919096 未加载
评论 #43924648 未加载
评论 #43919181 未加载
评论 #43921068 未加载
评论 #43921077 未加载
cristea1 день назад
Will it support Django stubs? Only blocker for my company to switch
pamelafoxоколо 15 часов назад
I am literally checking HackerNews while I wait for mypy to finish running, so I am excited to hear a faster type checker is on the way! Hope the error messages are also helpful.
评论 #43925826 未加载
no_timeоколо 15 часов назад
Awesome work. What is the business model for these astral tools? It’s a bit of a “waiting for the other shoe to drop” feeling after seeing the VC backing on the company page.
评论 #43923693 未加载
throwaway634671 день назад
I was wondering when someone would write a type checker in Rust, seemed like an obvious thing to do given how slow mypy is.
评论 #43920516 未加载
The-Ludwigоколо 11 часов назад
If this will be only 50% as awesome as ruff or uv, it will be a future must-have for me.
urbandw311erоколо 24 часов назад
It’s like when we hit a new month the quota of “talk about Rust” credits is renewed.
评论 #43921829 未加载
评论 #43922425 未加载
tiltowaitоколо 21 часа назад
I&#x27;ve been looking forward to this since the original announcement (and before, really).<p>On the modest codebase I tried it on (14k LOC across 126 files), it runs in 149ms compared to 1.66s in pyright (both run via uvx &lt;tool&gt;). I couldn&#x27;t get it to play nicely with a poetry project, but it works fine (obviously) in a uv project.<p>Definitely some false-positives, as expected. Interestingly, it seems to hate the `dict()` initializer (e.g. `dict(foo=&quot;bar&quot;)`).
评论 #43922832 未加载
pizzaоколо 23 часов назад
Probably not a top priority but it would be really really cool if this thing had solid t-string support from the jump, to the extent that it’s feasible without actually executing code
cyounkinsоколо 20 часов назад
How does Astral plan on making money?
评论 #43921733 未加载
Affricоколо 22 часов назад
See the thing about astral is that they get why Python has been successful in the first place:<p>When it was released it might have been one of the easiest to use languages.<p>The focus on tooling and making the tooling fast has been sharp. Seeing people recommend using non-astral tooling seems nuts at this point.
kodablah1 день назад
Fingers crossed this is&#x2F;becomes extensible. Pyright and MyPy both suffer from lack of extensibility IMO (Pyright doesn&#x27;t consider the use case and MyPy plugins come across as an afterthought with limited capabilities). There are many things that can be built on the back of type-checked AST.
评论 #43920133 未加载
评论 #43919190 未加载
Sariosоколо 18 часов назад
Perhaps a silly question. Will ty be usable for getting semantical completions &#x2F; suggestions. Similar to using pyright to get completions based on what&#x27;s being written.
评论 #43925841 未加载
joshdavhamоколо 23 часов назад
Any plans to create an official ty github action? I&#x27;ve been loving the ruff github action.
simlevesque1 день назад
I installed it in VSCode and removed Mypy, I haven&#x27;t looked back: <a href="https:&#x2F;&#x2F;marketplace.visualstudio.com&#x2F;items&#x2F;?itemName=astral-sh.ty" rel="nofollow">https:&#x2F;&#x2F;marketplace.visualstudio.com&#x2F;items&#x2F;?itemName=astral-...</a>
tayo421 день назад
Curious why so many people want to implement type checkers for python? What problems are being solved that aren&#x27;t covered already?
评论 #43920952 未加载
评论 #43920805 未加载
评论 #43920326 未加载
briandwоколо 23 часов назад
Looks good but it has the same issues that i have with mypy. Packages that don&#x27;t include the type hints blow-up my process. In mypy i&#x27;ve come to terms with strategically ignoring packages or finding a package of type hints. Mypy is runs cleanly on my project but I get &gt;800 errors with TY, mostly things like:<p>lint:unresolved-import: Cannot resolve imported module `pydantic` --&gt; vartia&#x2F;usr_id.py:4:6 | 2 | from typing import Optional, Any 3 | from enum import Enum 4 | from pydantic import BaseModel, ConfigDict<p>looking forward to the release version.
评论 #43920802 未加载
f311a1 день назад
Does it support go to definition and other lsp features?
评论 #43919885 未加载
ljouhetоколо 22 часов назад
uv is an incredible tool ; ty will be also. It&#x27;s insanely fast<p>For now, I have some false negative warnings :<p>&#x27;global&#x27; variables are flagged as undefined `int:unresolved-reference: Name ... used when not defined` (yeah, it&#x27;s bad, I know)<p>f(*args) flagged as missing arguments `lint:missing-argument: No arguments provided for required parameters ...`
评论 #43924207 未加载
robertwt7около 23 часов назад
This will be similar to Typescript I assume? If so I can’t wait to use it!! I cant count how many times I’ve searched for “TS like in Python” since I’ve started working on Python codebase. TS is so awesome that I use it 100% on new projects. Ruff is also very good, but with this, large code base Python will be a breeze to work with
评论 #43920785 未加载
dhruv3006около 5 часов назад
Great job!
TeeMassiveоколо 6 часов назад
Glad to see that we have the type-checking equivalent of Ruff!
sestepоколо 23 часов назад
Is this the same thing as Red Knot?
评论 #43920769 未加载
drcongo1 день назад
I&#x27;ve been looking forward to this for what seems like an age.
评论 #43919066 未加载
rowanG077около 23 часов назад
Recently I started a python project and I wanted to do it the &quot;proper&quot; way. mypy + pylint. But even on this small 15-20kloc program these tools are way to slow to do anything in realtime. It takes double digit seconds to have feedback. Way to long for an LSP. I&#x27;m honestly appalled the state of affairs is this bad. What the hell do people do with moderately or even large sized code bases?
评论 #43921731 未加载
评论 #43921622 未加载
评论 #43920879 未加载
joejoo1 день назад
Astral killing it with the Python tooling.
ivanbelenkyоколо 20 часов назад
holy shit this is happening
canterburryоколо 22 часов назад
How about we just stop creating non type safe languages. Would save everyone so much hassle.<p>[bring on the downvotes]
评论 #43921612 未加载
评论 #43921604 未加载