TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Pyright: Static type checker for Python

214 点作者 JacobHenner大约 6 年前

19 条评论

scrollaway大约 6 年前
I&#x27;m excited; this looks better than Pyre. It being in Typescript is ironically enough a pretty big deal.<p>I think they&#x27;re clearly writing this for vscode, right? I hope they are at least. Having spent the last decade and half writing Python code, I have completely stopped enjoying writing Python code (even typed Python) because of how <i>good</i> TypeScript and the VSCode typescript experience is. It doesn&#x27;t even sort of compare.<p>At this point I just want pretty much the same thing that happened to JS to happen to Python: For MS to make a Python superset with <i>good</i> type hinting (not the atrocious pep484 syntax) which compiles down to Python.<p>… and wasm. Which compiles down to Python and wasm.
评论 #19474311 未加载
评论 #19474085 未加载
评论 #19474307 未加载
anurag大约 6 年前
Microsoft, Facebook, and Google all have their own Python type checkers now.<p>* <a href="https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;pytype" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;pytype</a><p>* <a href="https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;pyre-check" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;pyre-check</a>
评论 #19474045 未加载
评论 #19477733 未加载
akubera大约 6 年前
I just installed it. It gives red squiggly lines under variables that haven&#x27;t been assigned (typos) and for incorrect methods on variables it can type-deduce. This is without me adding any typing-hints to the script I&#x27;m working on.<p>Only issue I see immediately is it does not use the default sys.path that the vs-code-configured python interpreter uses, so it cannot resolve some of the packages I&#x27;m using.<p>But overall, very nice.
StaticRedux大约 6 年前
Microsoft, please make one for Ruby! C# vet and lover of VS and VS Code, now working on a legacy Ruby&#x2F;Rails code base and hating a new life of lifecycle callbacks, fat controllers, fat models, magic methods, and un-upgradeable gems. Ugh.
评论 #19474075 未加载
评论 #19474192 未加载
评论 #19474072 未加载
评论 #19474069 未加载
berti大约 6 年前
&gt; Pyright is written in TypeScript and runs within node. It does not require a Python environment or imported third-party packages to be installed.<p>I know which of those environments I would prefer... it&#x27;s not node. It makes total sense for VS Code though, so fair enough.
fineoldcannibal大约 6 年前
As someone who has worked with Eric Traut (the primary author of this from what I can see) in a previous life, I will say you can take this to the bank any day of the week. One of the best developers out there
评论 #19479363 未加载
staticassertion大约 6 年前
Is mypy not open source? Why not collaborate? Mypy performance improvements are something that would be welcomed.
评论 #19475150 未加载
评论 #19474023 未加载
o10449366大约 6 年前
I could see this being nice if you work within VSCode, have to juggle many Python versions, and already have Node installed, but I&#x27;ve personally had no issues with speed or configurability with mypy and pyenv. I think it&#x27;s an interesting project, but probably half-baked at this point.
etatoby大约 6 年前
Flame mode on.<p>Can anybody explain to me why people seem to prefer using unsafe and interpreted&#x2F;slow languages (Python, Ruby, Javascript... which is only fast now because companies have invested millions on it) and then spend a ton of resources writing &quot;type checkers&quot; for these inherently unsafe languages (Typescript, Pyre, Pyright) Why don&#x27;t they simply use languages that are already safe and fast by design? (Rust, OCaml...)
评论 #19475380 未加载
评论 #19474814 未加载
评论 #19475013 未加载
评论 #19475153 未加载
grandinj大约 6 年前
Is it just me or did no one else parse this as a joke project because pyrite == fools gold?
评论 #19477307 未加载
externalreality大约 6 年前
I think this is great! Static typing is such a blessing. This one looks very high quality. Static typing helps me read code and helps the compiler do static analysis. What&#x27;s not to like?
评论 #19475433 未加载
ilovecaching大约 6 年前
I still don&#x27;t understand adding type checkers to dynamic languages beyond Javascript, where there was no other alternative. I view the gradual type checker craze as an admission that dynamically typed languages are a failed experiment. So why would you not just switch to a language that&#x27;s designed with static typing in mind.
评论 #19475213 未加载
评论 #19474803 未加载
评论 #19486425 未加载
评论 #19475278 未加载
roel_v大约 6 年前
Can this be run in real time in VSCode? How hard would it be to write a vim plugin for this? I haven&#x27;t done any vim scripting in a while - is it possible nowadays to run a process asynchronously, so that you could essentially run this tool on every keystroke?
评论 #19475194 未加载
评论 #19474308 未加载
Rotareti大约 6 年前
Now that we have type hints and statically typing in Python, I hope to see an open source Python compiler, that improves performance and produces single file binaries.
评论 #19475008 未加载
评论 #19486978 未加载
评论 #19478138 未加载
评论 #19474892 未加载
philonoist大约 6 年前
But why does each company have one for their own[0]?<p>[0]news.ycombinator.com&#x2F;item?id=19473944
MapleWalnut大约 6 年前
A comparison with mypy would be helpful.
评论 #19473897 未加载
laughingman2大约 6 年前
Any extensions for emacs?
formalsystem大约 6 年前
Does this work typecheck matrix operations?
mlevental大约 6 年前
is there a way to get any of these python typecheckers to automatically annotate my code?
评论 #19480427 未加载