タグ

pythonとmypyに関するkoma_gのブックマーク (2)

  • mypy 1.10.0 documentation

    Welcome to mypy documentation!¶ Mypy is a static type checker for Python. Type checkers help ensure that you’re using variables and functions in your code correctly. With mypy, add type hints (PEP 484) to your Python programs, and mypy will warn you when you use those types incorrectly. Python is a dynamic language, so usually you’ll only see errors in your code when you attempt to run it. Mypy is

  • Python の型ヒントと typing と mypy | 民主主義に乾杯

    めちゃくちゃ長いですが 変数や属性に代入されるオブジェクトの型名を書く という、ただそれだけの話です。 # 1. はじめに 型ヒントの書き方については mypy のマニュアルにチートシートがありました。 わかる方は、直接こちらをご参照ください。 Type hints cheat sheet (Python 3) - mypy (opens new window) また型ヒントをいつ使うのか、と言った 「使い分け」 、型ヒントが登場した 「背景」 については、 以下の記事にまとめました。記事の後編にあたります。 動的言語と静的言語ってなに? この記事では主に 「書き方」 と 「使い方」 について、書いていきます。 # 1.1. 型ヒント 変数に代入される型の名前です。 正確には違います。引用先の用語集をご参照ください。

  • 1