from typing import Dict class MyDict(dict): pass def f() -> Dict[int, int]: # works return {} def g() -> MyDict[int, int]: # expected no type argumen