#You can use mypy to perform a static typecheck #For more details on typing see #https://docs.python.org/3/library/typing.html from typing import List class MyAlmostInterface: def do_stuffA(self, x: str, y: int) -> str: pass def do_stuffB(self, x:int) -> List[int]: pass class InterfaceImpl(MyAlmostInterface): def do_stuffA(self, x: str, y: int) -> str: return x def do_stuffB(self, x:int) -> List[int]: return [x+1, x] def fun(ii: MyAlmostInterface) ->List[int]: return ii.do_stuffB(4) print(fun(InterfaceImpl()))