For style reasons I'm trying to keep definition of myDict before class Foo. This will cause a NameError because Foo is not yet defined.
from typing import Dict
myDict: Dict[str, Foo] = {}
class Foo:
pass
Moving myDict below Foo obviously fixes this, but is there any way I can keep myDict and its annotation up top?