Skip to content

python typing check types

MilesBai edited this page Jun 9, 2025 · 1 revision

types.FunctionType

dynamically create a class function

def test_func(): print 'wow' 
dynf = types.FunctionType(test_func.func_code, {})
dynf()

https://stackoverflow.com/a/10303539

typing check 只是提示。

numpy typing

https://stackoverflow.com/a/35688036

https://docs.python.org/3/library/typing.html

example1

from typing import Dict, List

def func(a: List[str]):

Clone this wiki locally