[New-bugs-announce] [issue42592] TypedDict: total=False but still key required

Paul Bryan report at bugs.python.org
Mon Dec 7 12:36:35 EST 2020

New submission from Paul Bryan <pbryan at anode.ca>:

I believe "a" below should be an optional key, not a required one.

Python 3.9.0 (default, Oct  7 2020, 23:09:01) 
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import typing
>>> TD = typing.TypedDict("TD", {"a": str}, total=False)
>>> TD.__total__
>>> TD.__required_keys__
>>> TD.__optional_keys__

components: Library (Lib)
messages: 382662
nosy: gvanrossum, pbryan
priority: normal
severity: normal
status: open
title: TypedDict: total=False but still key required
type: behavior
versions: Python 3.9

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list