PEP 728: TypedDict with Typed Extra Fields by PIG208 · Pull Request #3441 · python/peps

JelleZijlstra

stroxler

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
I left out the rewrite to other proposed syntax such as using
"OtherFields[]" with an arbitrary key before there is sufficient
discussion on the alternatives available to us.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>

PIG208

Also split parts of it into individual sections dicussing changes to
TypedDict type consistency with Mapping and dict.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Addresses some review feedback.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Signed-off-by: Zixuan James Li <p359101898@gmail.com>

@PIG208

This follows the style of PEP 705 and the majority of the typing spec to
use "key" or "item" instead of "field" depending on the context. It also
makes use of "value type" more to be adequately more pedantic. The
special key added is now referred to as the "reserved key" to make it
clearer that it is not intended for other purposes anymore.

It also make use of type aliases like `VT` more for brevity.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>

JelleZijlstra

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Signed-off-by: Zixuan James Li <p359101898@gmail.com>

JelleZijlstra

JelleZijlstra

@JelleZijlstra

JelleZijlstra

hugovk