bpo-46066: Deprecate kwargs syntax for TypedDict definitions#31126
bpo-46066: Deprecate kwargs syntax for TypedDict definitions#31126JelleZijlstra merged 11 commits into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
|
Surely this is a breaking change — even if type-checkers only understand the literal-dict assignment-based syntax, I'm not sure we can change the runtime behaviour like this without a deprecation period. |
Sorry, something went wrong.
|
Yeah, it changes the typing module. However I seldom see this syntax in real-world projects since we already have class based one. |
Sorry, something went wrong.
|
I am not really familiar with the cpython developing period. It's not a big deal since neither mypy nor other widely-used type checkers implement this feature and I barely see this syntax in real world projects. |
Sorry, something went wrong.
I appreciate that — but given that this is a change to the stdlib, I think the standard deprecation policy probably still applies :) |
Sorry, something went wrong.
Thanks for pointing out! |
Sorry, something went wrong.
|
For now, I think I would:
Here's an example of a previous PR deprecating features, that you could look to as an example: #23064 |
Sorry, something went wrong.
Co-authored-by: AlexWaygood <Alex.Waygood@Gmail.com>
|
Also, it looks like there's some trailing whitespace in some of the documentation changes you've made, which is making the documentation-related tests fail -- could you possibly fix those issues? |
Sorry, something went wrong.
|
@AlexWaygood Thanks for your reviews! btw, it seems that CI reports wrong line number about the trailing whitespace. |
Sorry, something went wrong.
No worries, it's a good PR!
Huh — no idea what might be causing that :) |
Sorry, something went wrong.
AlexWaygood
left a comment
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
As this is a deprecation of an existing feature, I think it probably warrants a mention in "What's New in Python 3.11". I think @JelleZijlstra is planning on doing a PR for that document mentioning a bunch of recent changes to |
Sorry, something went wrong.
|
@gvanrossum, could we possibly get the full test suite run on this PR, please? :) |
Sorry, something went wrong.
gvanrossum
left a comment
There was a problem hiding this comment.
I can't stand "firstly" and "secondly" for some reason. :-(
Sorry, something went wrong.
How about "The first one" and "The other one"? |
Sorry, something went wrong.
Probably, a bullet list will be better. Like this:
|
Sorry, something went wrong.
JelleZijlstra
left a comment
There was a problem hiding this comment.
Here's a concrete wording suggestion that avoids "Firstly" and "Secondly"
Sorry, something went wrong.
|
I was just hoping to see “first“ and “second”. No “ly” needed, these are flat adverbs. |
Sorry, something went wrong.
|
In a few days Jelle can likely merge this himself. :-) |
Sorry, something went wrong.
|
Congrats Jelle! |
Sorry, something went wrong.
|
And congrats @97littleleaf11 on your first CPython contribution! |
Sorry, something went wrong.
Closes python/typing#981
https://bugs.python.org/issue46066