GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Argument Clinic doesn't mangle conflicting names · Issue #68395 · python/cpython

Argument Clinic doesn't mangle conflicting names #68395

New issue
Copy link
New issue
Copy link
Closed
#104065
Closed
Argument Clinic doesn't mangle conflicting names#68395
#104065
Copy link
Labels
topic-argument-clinictype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@serhiy-storchaka
serhiy-storchaka
opened on May 16, 2015
Issue body actions
BPO 24207
Nosy @larryhastings, @serhiy-storchaka

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 = None
closed_at = None
created_at = <Date 2015-05-16.10:21:03.935>
labels = ['type-bug', 'expert-argument-clinic']
title = "Argument Clinic doesn't mangle conflicting names"
updated_at = <Date 2015-05-16.10:21:03.935>
user = 'https://github.com/serhiy-storchaka'

bugs.python.org fields:

activity = <Date 2015-05-16.10:21:03.935>
actor = 'serhiy.storchaka'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Argument Clinic']
creation = <Date 2015-05-16.10:21:03.935>
creator = 'serhiy.storchaka'
dependencies = []
files = []
hgrepos = []
issue_num = 24207
keywords = []
message_count = 1.0
messages = ['243304']
nosy_count = 2.0
nosy_names = ['larry', 'serhiy.storchaka']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue24207'
versions = ['Python 3.5']

Linked PRs

  • gh-68395: Avoid naming conflicts by mangling variable names in Argument Clinic #104065

Activity

  1. serhiy-storchaka commented on May 16, 2015

    @serhiy-storchaka
    serhiy-storchaka
    on May 16, 2015
    MemberAuthor
    More actions

    Argument Clinic adds the "_value" suffix to the end of variable names in C if the parameter name is C keyword. But it left unmodified parameter names that can conflict with parameter names of C function: args and kwargs (and module and self if they are used not as the first parameter). Following declaration generates a code that can't bi compiled:

    mod.func

    args: object
    kwargs: object
    

    Either Argument Clinic should add the "_value" suffix to the end of these names, or use other names for parameters of generated parser function.

  2. serhiy-storchaka
    added
    topic-argument-clinic
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on May 16, 2015
  3. ezio-melotti
    transferred this issue fromon Apr 10, 2022
  4. erlend-aasland commented on May 1, 2023

    @erlend-aasland
    erlend-aasland
    on May 1, 2023
    Contributor
    More actions

    args is already mangled as __clinic_args. We should also mangle kwnames, since that is sometimes used instead of kwargs (for example, for METH_FASTCALL | METH_KEYWORDS).

  5. erlend-aasland
    added 2 commits that reference this issue on May 1, 2023

    pythongh-68395: Avoid naming conflicts by mangling variable names in …

    8acfbe7

    pythongh-68395: Avoid naming conflicts by mangling variable names in …

    9a74d01
  6. erlend-aasland commented on May 5, 2023

    @erlend-aasland
    erlend-aasland
    on May 5, 2023
    Contributor
    More actions

    FTR, AC complains if you try to use parameters named self (for methods) or module (for functions), so we don't need to special case those two.

    Example failure if I try to add a param named "self" to sqlite3.Connection.__init__:

    Error in file "Modules/_sqlite/connection.c" on line 217:
    Parameter 'self' requires a custom C name
    
  7. erlend-aasland
    linked a pull request that will close this issuegh-68395: Avoid naming conflicts by mangling variable names in Argument Clinic #104065on May 5, 2023
  8. erlend-aasland
    closed this as completedin #104065on May 5, 2023
  9. erlend-aasland
    added a commit that references this issue on May 5, 2023

    gh-68395: Avoid naming conflicts by mangling variable names in Argume…

    5245cb6
  10. carljm
    added a commit that references this issue on May 5, 2023

    Merge branch 'main' into inlinecomp2

    8a78a36
  11. jbower-fb
    added a commit that references this issue on May 8, 2023

    pythongh-68395: Avoid naming conflicts by mangling variable names in …

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-argument-clinictype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.