Replies: 1 comment 4 replies
-
Pyright's behavior here is correct. A There is a new proposed feature in draft PEP 728 that introduces the concept of "closed" TypedDicts. Pyright has provisional (experimental) support for this feature if you want to play with it, but I wouldn't recommend using this feature in production code until the PEP has been finalized and accepted by the steering council. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a bit unusual use-case of
TypedDict
like so:Screenshot (please ignore the red error):
My question is, why is pyright here returning the type of 'val' in inner for-loop as 'object'? It should be of
typing.Dict[SIZE, SizeMap]
type instead. What am I doing wrong here? or is pyright in wrong here?Beta Was this translation helpful? Give feedback.
All reactions