TypeError: 'dict_keys' object is not subscriptable code example
Example 1: python 'dict_keys' object is not subscriptable
vocab = list(fdist1.keys())
Example 2: TypeError: '_TypedDict' object is not subscriptable
You can't subscript TypedDict; you're meant to instantiate or subclass one according to the docs:
Point2D = TypedDict('Point2D', x=int, y=int, label=str)
Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})
With that in mind, you can just inline that in your signature:
def x(a: TypedDict('A', x=int)):
pass