Python equivalent to `as` type assertion in TypeScript
Python equivalent to `as` type assertion in TypeScript Question: In TypeScript you can override type inferences with the as keyword const canvas = document.querySelector(‘canvas’) as HTMLCanvasElement; Are there similar techniques in Python3.x typing without involving runtime casting? I want to do something like the following: class SpecificDict(TypedDict): foo: str bar: str res = request(url).json() as …