TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Pyright: Static type checker for Python

214 pointsby JacobHennerabout 6 years ago

19 comments

scrollawayabout 6 years ago
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 未加载
anuragabout 6 years ago
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 未加载
akuberaabout 6 years ago
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.
StaticReduxabout 6 years ago
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 未加载
bertiabout 6 years ago
&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.
fineoldcannibalabout 6 years ago
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 未加载
staticassertionabout 6 years ago
Is mypy not open source? Why not collaborate? Mypy performance improvements are something that would be welcomed.
评论 #19475150 未加载
评论 #19474023 未加载
o10449366about 6 years ago
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.
etatobyabout 6 years ago
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 未加载
grandinjabout 6 years ago
Is it just me or did no one else parse this as a joke project because pyrite == fools gold?
评论 #19477307 未加载
externalrealityabout 6 years ago
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 未加载
ilovecachingabout 6 years ago
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_vabout 6 years ago
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 未加载
Rotaretiabout 6 years ago
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 未加载
philonoistabout 6 years ago
But why does each company have one for their own[0]?<p>[0]news.ycombinator.com&#x2F;item?id=19473944
MapleWalnutabout 6 years ago
A comparison with mypy would be helpful.
评论 #19473897 未加载
laughingman2about 6 years ago
Any extensions for emacs?
formalsystemabout 6 years ago
Does this work typecheck matrix operations?
mleventalabout 6 years ago
is there a way to get any of these python typecheckers to automatically annotate my code?
评论 #19480427 未加载