1 2 3 4 5 6 7 8 9 10 11 12 13 14
from typing import Callable class MyErr(Exception): def __init__(self): Exception.__init__(self) class MyErr2(Exception): def __init__(self): Exception.__init__(self) def f(fun: Callable[[int], int]): g() def g(): pass