You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix TypedDict against PartialTypedDict matching in is_subset_eq
Summary:
* Forbid updating a read-only field. This is in the spec: https://typing.python.org/en/latest/spec/typeddict.html#update-method.
* Do an is_subset_eq check on field types. Mypy and pyright disagree on whether the field types need to be identical or one needs to be a subtype of the other, so I took the more lenient of the two approaches.
* Don't error on extra items, as neither mypy nor pyright does so, presumably because a TypedDict can have extra items through inheritance.
Reviewed By: samwgoldman
Differential Revision: D78768100
fbshipit-source-id: d3c24de975fa2620e9c3174e8e453d5f08e492fe
0 commit comments