10 Mar
2021
10 Mar
'21
11:14 a.m.
Thanks for the additional context, Jukka. Here's what I've implemented in the latest release of pyright: 1. A subscripted access to a non-required TypedDict key generates an error unless it is guarded by a conditional check of the form `"some_key" in x`. The error is generated in normal type checking mode, not only in "strict" mode. 2. The `get` method for a non-required TypedDict key returns an `Optional[T]` type, whereas the `get` method for a required TypedDict key returns a `T` type (non-optional). -- Eric Traut Contributor to Pyright & Pylance Microsoft Corp.