GeezerVison is showing github.com — Deprecate keyword args syntax for TypedDict definition · Issue #90224 · python/cpython
Deprecate keyword args syntax for TypedDict definition #90224Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = <Date 2022-02-17.03:26:40.796>
created_at = <Date 2021-12-13.15:36:57.408>
labels = ['type-bug', 'library', '3.11']
title = 'Deprecate keyword args syntax for TypedDict definition'
updated_at = <Date 2022-02-20.01:44:58.632>
user = 'https://github.com/97littleleaf11'
bugs.python.org fields:
activity = <Date 2022-02-20.01:44:58.632>
actor = 'JelleZijlstra'
assignee = 'none'
closed = True
closed_date = <Date 2022-02-17.03:26:40.796>
closer = 'JelleZijlstra'
components = ['Library (Lib)']
creation = <Date 2021-12-13.15:36:57.408>
creator = '97littleleaf11'
dependencies = []
files = []
hgrepos = []
issue_num = 46066
keywords = ['patch']
message_count = 11.0
messages = ['408458', '408476', '408547', '412990', '413013', '413014', '413016', '413379', '413531', '413535', '413562']
nosy_count = 7.0
nosy_names = ['gvanrossum', 'JelleZijlstra', 'xtreak', 'sobolevn', 'kj', 'AlexWaygood', '97littleleaf11']
pr_nums = ['31126', '31428']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue46066'
versions = ['Python 3.11']
Activity97littleleaf11 commented on Dec 13, 2021 MannequinAuthor More actions 97littleleaf11 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, 202197littleleaf11 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, 2021gvanrossum commented on Dec 13, 2021 This is not really just a doc issue then, is it? Maybe we should just deprecate the feature? 97littleleaf11 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, 2021AlexWaygood commented on Feb 10, 2022 Just so that all the discussion related to this issue can be found in one place, here's a summary:
gvanrossum commented on Feb 10, 2022 Go ahead and send a or to deprecate it.--
--Guido (mobile) gvanrossum commented on Feb 10, 2022 AlexWaygood commented on Feb 10, 2022 @guido, OP already has — Jelle and I have both reviewed and approved it :) JelleZijlstra commented on Feb 17, 2022 tirkarthi commented on Feb 19, 2022 This change has introduced deprecation warning in tests
PYTHONWARNINGS=always ./python -Wall -X dev -m test.test_typing
........................................................................................................................................................................................................................s................................................................................................................................................................................................./home/karthikeyan/stuff/python/cpython/Lib/test/test_typing.py:4589: DeprecationWarning: The kwargs-based syntax for TypedDict definitions is deprecated in Python 3.11, will be removed in Python 3.13, and may not be understood by third-party type checkers.
TypedDict('Emp', _fields={'name': str, 'id': int})
./home/karthikeyan/stuff/python/cpython/Lib/test/test_typing.py:4602: DeprecationWarning: The kwargs-based syntax for TypedDict definitions is deprecated in Python 3.11, will be removed in Python 3.13, and may not be understood by third-party type checkers.
TypedDict('Hi', x=1)
........................................
Ran 451 tests in 0.105s
OK (skipped=1) JelleZijlstra commented on Feb 19, 2022 JelleZijlstra commented on Feb 20, 2022 gvanrossum commented on Dec 22, 2022 @labrys
Doesn't this cause issues for keys that are valid as keys but not as identifiers?
To the contrary, the deprecated syntax caused issues for such keys. The syntax that isn't deprecated works fine, e.g.
Point2D = TypedDict('Point2D', {'x': int, 'y': int, '$label$': str})Reacted by Jelle Zijlstra labrys commented on 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.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|