Skip to content

Statically Initialize PyArg_Parser in clinic.py #90928

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

    1. 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.

    2. transferred this issue fromon Apr 10, 2022
    3. added a commit that references this issue on Aug 11, 2022
    4. ericsnowcurrently commented on Aug 12, 2022

      @ericsnowcurrently
      MemberAuthor

      gh-95909 follows up on interpreter isolation for PyArg_Parser.

    5. added a commit that references this issue on Aug 13, 2022
    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