# typing モジュールからCallableをインポート from typing import Callable # 関数を引数に取る関数 # callback の型: 引数(int, int)、戻り値int の関数 def apply_operation( a: int, b: int, callback: Callable[[int, int], int] ) -> int: # ...
Python is best thought of as a dynamic but strongly typed language. Types aren’t associated with the names of things, but with the things themselves. This makes Python flexible and convenient for ...