pythonの型チェッカとしてはMypyが有名だと思います。私は普段Mypyを使っていますが、Facebookの開発したPyreというのがあることを知ったので使ってみました。 この記事では「FacebookはなぜPyreを開発したのか」とか「MypyとPyreの特徴比較」とかの話はしません。あくまで自分が使ってみた所感をまとめるだけです。 インストール 公式サイトにあるとおり、python>=3.5でpip install pyre-checkとするだけです。 いきなりVSCode拡張をインストール(おすすめしません) これまた公式サイトの手順に従えば、チェックに引っかかったところをVSCodeで表示することができます。 pyre initとするとソースのディレクトリを聞かれるので指定します。あとは普通のVSCode拡張と同じで、インストールして再読込します。 おそらくおびただしい数のエラ
TL; DR こいつを使うと、Annotation を追加していない部分に自動的に適用してくれます。 github.com もう少し詳しく 詳しい使い方はリポジトリを見ていただくとして、要はこの実装に対して実行すると、 gist.github.com こういう風になります。 gist.github.com 残念ながらこのエントリを書いている本日現在では python3 形式での変換には対応していないようですが、README の TODO に Python 3 code generation. と書いてあるのでそのうち対応されるんではないでしょうか。 ちなみに手動で書き換えるとこういう風になるんだと思います。 gist.github.com pytest と組み合わせるとさらに便利 pyannotate は実際に実行してみた結果を収集しながら型情報を適用するための JSON ファイルを生成
TL;DR: The last supported Python version for Pytype will be 3.12. We are still very actively interested in the space of Python type checking, but shifting our investments towards new ideas and different frameworks. Pytype's development began in 2012 to meet Google developers' demand for compile-time checking. Pytype started with using type inference and interface files, and then switched to inline
Today we are excited to announce we’re open-sourcing MonkeyType, our tool for automatically adding type annotations to your Python 3 code via runtime tracing of types seen. MotivationAt Instagram we have hundreds of engineers working on well over a million lines of Python 3. Every day we have new engineers joining the team from other projects and other languages who need to ramp up quickly and get
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く