On Thu, 2021-02-11 at 21:51 -0800, Guido van Rossum wrote:
[snip]
4. When iterating through the TypedDict.__annotations__, will Required[...] be retained there, or would it need to be discovered through __required_keys__, or both?
Together, it seems the best would be to always suppress Required, and only store that info in __required_keys__. Unless I'm missing something subtle (somehow this all sounds like a series of trick questions :-).
+1. No trick questions. 😉
5. Could we do away (or at least deprecated) totality in TypedDict, and rely on this mechanism? (and/or possibly codify the use of __required_keys__?)
Do you mean the __total__ attribute? I guess that's already been superseded by __required_keys__ (and __optional_keys__ -- I don't recall why we need both).
Well, yes, __total__ as well as total=... initialization parameter. They must die!