Skip to content
/ cpython Public
  • Sponsor python/cpython

  • Notifications You must be signed in to change notification settings
  • Fork 32.3k

Statically Initialize PyArg_Parser in clinic.py #90928

Closed
@ericsnowcurrently

Description

@ericsnowcurrently
BPO 46772
Nosy @ericsnowcurrently
Dependencies
  • bpo-46753: Statically allocate and initialize the empty tuple.
  • bpo-46773: Add a Private API for Looking Up Global Objects
  • 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 = 'https://github.com/ericsnowcurrently'
    closed_at = None
    created_at = <Date 2022-02-16.18:32:25.886>
    labels = ['interpreter-core', '3.11']
    title = 'Statically Initialize PyArg_Parser in clinic.py'
    updated_at = <Date 2022-02-16.18:36:54.761>
    user = 'https://github.com/ericsnowcurrently'

    bugs.python.org fields:

    activity = <Date 2022-02-16.18:36:54.761>
    actor = 'eric.snow'
    assignee = 'eric.snow'
    closed = False
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2022-02-16.18:32:25.886>
    creator = 'eric.snow'
    dependencies = ['46753', '46773']
    files = []
    hgrepos = []
    issue_num = 46772
    keywords = []
    message_count = 1.0
    messages = ['413351']
    nosy_count = 1.0
    nosy_names = ['eric.snow']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue46772'
    versions = ['Python 3.11']

    Activity

    ericsnowcurrently

    ericsnowcurrently commented on Feb 16, 2022

    @ericsnowcurrently
    MemberAuthor

    The code generated by clinic.py is already partially statically initialized. Currently we init the other fields in Python/getargs.c:parser_init(), which runs the first time we try to use each parser. AFAICS, that remaining init that could be done statically using the data we have available in clinic.py during code generation.

    My primary interest is in static init of PyArg_Parser.kwtuple, which is a tuple containing only strings.

    transferred this issue fromon Apr 10, 2022
    added a commit that references this issue on Aug 11, 2022

    gh-90928: Statically Initialize the Keywords Tuple in Clinic-Generate…

    6f6a4e6
    ericsnowcurrently

    ericsnowcurrently commented on Aug 12, 2022

    @ericsnowcurrently
    MemberAuthor

    gh-95909 follows up on interpreter isolation for PyArg_Parser.

    2 remaining items

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Labels

    3.11only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Statically Initialize PyArg_Parser in clinic.py · Issue #90928 · python/cpython