Skip to content

conformance: make open TypedDict extra kwargs optional#2301

Merged
carljm merged 1 commit into
python:mainfrom
charliermarsh:charlie/optional-open-typeddict-unpack-extra-key
Jun 5, 2026
Merged

conformance: make open TypedDict extra kwargs optional#2301
carljm merged 1 commit into
python:mainfrom
charliermarsh:charlie/optional-open-typeddict-unpack-extra-key

Conversation

@charliermarsh
Copy link
Copy Markdown
Contributor

Summary

#2272 made errors optional when an extra keyword is passed to **kwargs: Unpack[OpenTypedDict], modifying the expectation in callables_kwargs.py. But typeddicts_extra_items.py contains the same case:

class MovieNoExtra(TypedDict):
    name: str

def unpack_no_extra(**kwargs: Unpack[MovieNoExtra]) ->
None: ...

unpack_no_extra(name="No Country for Old Men",
year=2007)  # E?

This PR marks the duplicate case optional, for consistency with #2272.

@charliermarsh charliermarsh force-pushed the charlie/optional-open-typeddict-unpack-extra-key branch from 68e0010 to 4d8dbf9 Compare June 5, 2026 11:06
Copy link
Copy Markdown
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree this seems exactly analogous to the change in #2272.

@carljm carljm merged commit 735dba9 into python:main Jun 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants