8000 gh-90928: Statically Initialize the Keywords Tuple in Clinic-Generated Code by ericsnowcurrently · Pull Request #95860 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-90928: Statically Initialize the Keywords Tuple in Clinic-Generated Code #95860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add a comment.
  • Loading branch information
ericsnowcurrently committed Aug 11, 2022
commit 44a193bd1826d841acb0452917b9e4d6fe4479c8
6 changes: 6 additions & 0 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,12 @@ def normalize_snippet(s, *, indent=0):


def declare_parser(*, hasformat=False):
"""
Generates the code template for a static local PyArg_Parser variable,
with an initializer. For core code (incl. builtin modules) the
kwtuple field is also statically initialized. Otherwise
it is initialized at runtime.
"""
if hasformat:
fname = ''
format_ = '.format = "{format_units}:{name}",'
Expand Down
0