Improve performance of keyword arguments collected by **kwargs · Issue #163213 · python/cpython
Repository navigation
Improve performance of keyword arguments collected by **kwargs #163213
New issue
New issue
Backlog
Backlog
Improve performance of keyword arguments collected by **kwargs #163213 Labels
interpreter-core
performance
type-feature
Description
@eendebakpt's profile eendebakpt opened on Dec 5, 2026Feature or enhancement
A keyword that does not name a parameter is first looked up among the parameter names by identity and then, as a fallback, compared with each of them by value before it goes into **kwargs. Parameter names are always interned (intern_strings() in _PyCode_New()), so an interned keyword that was not found by identity cannot match, and the fallback loop can be skipped. Keywords that are not interned, including instances of str subclasses, are compared as before.
Linked PRs
Metadata
Metadata
Assignees
No one assignedLabels
interpreter-core
performance
type-feature