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
{{ message }}
Repository navigation
Deprecate keyword args syntax for TypedDict definition #90224
changed the title [-]Docs: TypedDict alternative definition syntax with keyword args is confusing[/-][+][doc] TypedDict alternative definition syntax with keyword args is confusing[/+]on Dec 13, 2021
changed the title [-]Docs: TypedDict alternative definition syntax with keyword args is confusing[/-][+][doc] TypedDict alternative definition syntax with keyword args is confusing[/+]on Dec 13, 2021
changed the title [-][doc] TypedDict alternative definition syntax with keyword args is confusing[/-][+]TypedDict alternative definition syntax with keyword args is confusing[/+]on Dec 14, 2021
@gvanrossum Thanks for the quick response. I deleted my previous comment right after I posted it realizing I had entirely misread it as if the kwargs method was the one being retained.
Activity
97littleleaf11 commentedon Dec 13, 2021
According to the docs: https://docs.python.org/3/library/typing.html?#typing.TypedDict, there are two additional equivalent syntax for TypedDict definition.
However, the former one is quite confusing since we have the
totalkeyword arg for TypedDict. In addition, PEP-589(https://www.python.org/dev/peps/pep-0589/#id19) doesn't have this.I think we could discard the definition syntax using keyword args in the doc.
[-]Docs: TypedDict alternative definition syntax with keyword args is confusing[/-][+][doc] TypedDict alternative definition syntax with keyword args is confusing[/+][-]Docs: TypedDict alternative definition syntax with keyword args is confusing[/-][+][doc] TypedDict alternative definition syntax with keyword args is confusing[/+]gvanrossum commentedon Dec 13, 2021
This is not really just a doc issue then, is it? Maybe we should just deprecate the feature?
[-][doc] TypedDict alternative definition syntax with keyword args is confusing[/-][+]TypedDict alternative definition syntax with keyword args is confusing[/+]20 remaining items
AlexWaygood commentedon Feb 10, 2022
Just so that all the discussion related to this issue can be found in one place, here's a summary:
gvanrossum commentedon Feb 10, 2022
Go ahead and send a or to deprecate it.--
--Guido (mobile)
gvanrossum commentedon Feb 10, 2022
"PR"
AlexWaygood commentedon Feb 10, 2022
@guido, OP already has — Jelle and I have both reviewed and approved it :)
JelleZijlstra commentedon Feb 17, 2022
New changeset de6043e by 97littleleaf11 in branch 'main':
bpo-46066: Deprecate kwargs syntax for TypedDict definitions (GH-31126)
de6043e
tirkarthi commentedon Feb 19, 2022
This change has introduced deprecation warning in tests
Ran 451 tests in 0.105s
OK (skipped=1)
JelleZijlstra commentedon Feb 19, 2022
Thanks, I'll send a PR.
JelleZijlstra commentedon Feb 20, 2022
New changeset 0a8a8e7 by Jelle Zijlstra in branch 'main':
bpo-46066: Check DeprecationWarning in test_typing (GH-31428)
0a8a8e7
gvanrossum commentedon Dec 22, 2022
@labrys
To the contrary, the deprecated syntax caused issues for such keys. The syntax that isn't deprecated works fine, e.g.
labrys commentedon Dec 22, 2022
@gvanrossum Thanks for the quick response. I deleted my previous comment right after I posted it realizing I had entirely misread it as if the kwargs method was the one being retained.