組み込み型
公式サイト:
基本
参考:
Python で型を極める (Python 3.9 対応) – Qiita
型変換/キャスト
参考:
任意のオブジェクトを型変換/キャストする方法 | ゆうまるブログ
文字列を数値に変換して数値と演算する | Let’s プログラミング
キャスト徹底解説 (int / float / complex / str) | 侍エンジニアブログ
Python 3 のデータ型を変換する方法 | DigitalOcean
判定する
type
isinstance
変数の内容が文字列がどうか判定する。
var = "Hello"
if type(var) is str:
print("My name is John!")
Code language: Python (python)
参考:
型判定で使える組み込み関数 type() と isinstance() をまとめた – Qiita
type 関数/isinstance 関数 – 型を取得/判定する | note.nkmk.me
isinstance | Python 3.x ドキュメント [公式]
データモデル
参考:
データモデル | Python 3.x ドキュメント [公式]
typing
参考:
typeing – 型ヒントのサポート | Python 3.x ドキュメント [公式]
整数の最大値
参考:
Python 3 の整数 int 型に最大値はない/上限なし | note.nkmk.me
sys.maxsize | Python 3.x ドキュメント [公式]
What are the currently possible values for sys.maxsize? – Stack Overflow
クラスかどうか判定する
参考:
inspect.isclass | Python 3.x ドキュメント [公式]
まとめ
参考: