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 — gh-104389: Add 'unused' keyword to Argument Clinic C converters by erlend-aasland · Pull Request #104390 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented May 11, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Use the unused keyword param in the converter to explicitly
mark an argument as unused:

/*[clinic input]
BaseClass.interface
    flag: bool(unused=True)
  • Issue: Make it possible to mark Argument Clinic args as unused #104389

📚 Documentation preview 📚: https://cpython-previews--104390.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

arhadthedev and corona10 reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@erlend-aasland
pythongh-104389: Argument Clinic now wraps unused args with Py_UNUSED
2def279
Use the unused keyword param in the converter to explicitly
mark an argument as unused:

    /*[clinic input]
    BaseClass.interface
        flag: bool(unused=True)
@erlend-aasland
erlend-aasland requested a review from vstinner May 11, 2023 13:10
@bedevere-bot bedevere-bot added the awaiting core review label May 11, 2023
@bedevere-bot bedevere-bot mentioned this pull request May 11, 2023
Make it possible to mark Argument Clinic args as unused #104389
Closed
@erlend-aasland
Add NEWS entry
90c6644
@erlend-aasland

erlend-aasland commented May 11, 2023

Copy link
Copy Markdown
Contributor Author

The _io change is to show the feature; we can revert it before landing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
Fix docs
d0f2b5a
corona10
corona10 approved these changes May 11, 2023
View reviewed changes

@corona10 corona10 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels May 11, 2023
@erlend-aasland erlend-aasland changed the title gh-104389: Argument Clinic now wraps unused args with Py_UNUSED gh-104389: Add 'unused' keyword to Argument Clinic C converters May 11, 2023
erlend-aasland added 2 commits May 11, 2023 19:05
@erlend-aasland
Revert _io example
b03874b
@erlend-aasland
Add test
bd4b10a
@vstinner

vstinner commented May 11, 2023

Copy link
Copy Markdown
Member

Do you have at least one use case for this addition?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner approved these changes May 11, 2023
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It would be nice to have directly an user of this feature, but I'm fine with adding support for it, and later have a separated PR using it. I see where you will use it in the _io extension ;-)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with laugh emoji
All reactions
  • 😄 1 reaction
@erlend-aasland

erlend-aasland commented May 12, 2023

Copy link
Copy Markdown
Contributor Author

LGTM. It would be nice to have directly an user of this feature, but I'm fine with adding support for it, and later have a separated PR using it. I see where you will use it in the _io extension ;-)

Yes, I'll create PRs for usage quite soon :)

Anyway, I got two approvals here, a couple of thumbs up on the PR, five likes on the Discourse topic. I'll land this soon.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
erlend-aasland merged commit b2c1b4d into python:main May 12, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label May 12, 2023
@erlend-aasland
erlend-aasland deleted the clinic-unused branch May 12, 2023 08:34
@erlend-aasland erlend-aasland linked an issue May 12, 2023 that may be closed by this pull request
Make it possible to mark Argument Clinic args as unused #104389
Closed
@erlend-aasland

erlend-aasland commented May 12, 2023

Copy link
Copy Markdown
Contributor Author

LGTM. It would be nice to have directly an user of this feature, but I'm fine with adding support for it, and later have a separated PR using it. I see where you will use it in the _io extension ;-)

PR for _io usage:

  • gh-101819: Fix _io clinic input for unused base class method stubs #104418
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented May 12, 2023

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Debian root 3.x has failed when building commit b2c1b4d.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/345/builds/4762) and take a look at the build logs.
  4. Check if the failure is related to this commit (b2c1b4d) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/345/builds/4762

Failed tests:

  • test_threading
  • test_multiprocessing_forkserver

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 46, done.        
remote: Counting objects:   2% (1/46)        
remote: Counting objects:   4% (2/46)        
remote: Counting objects:   6% (3/46)        
remote: Counting objects:   8% (4/46)        
remote: Counting objects:  10% (5/46)        
remote: Counting objects:  13% (6/46)        
remote: Counting objects:  15% (7/46)        
remote: Counting objects:  17% (8/46)        
remote: Counting objects:  19% (9/46)        
remote: Counting objects:  21% (10/46)        
remote: Counting objects:  23% (11/46)        
remote: Counting objects:  26% (12/46)        
remote: Counting objects:  28% (13/46)        
remote: Counting objects:  30% (14/46)        
remote: Counting objects:  32% (15/46)        
remote: Counting objects:  34% (16/46)        
remote: Counting objects:  36% (17/46)        
remote: Counting objects:  39% (18/46)        
remote: Counting objects:  41% (19/46)        
remote: Counting objects:  43% (20/46)        
remote: Counting objects:  45% (21/46)        
remote: Counting objects:  47% (22/46)        
remote: Counting objects:  50% (23/46)        
remote: Counting objects:  52% (24/46)        
remote: Counting objects:  54% (25/46)        
remote: Counting objects:  56% (26/46)        
remote: Counting objects:  58% (27/46)        
remote: Counting objects:  60% (28/46)        
remote: Counting objects:  63% (29/46)        
remote: Counting objects:  65% (30/46)        
remote: Counting objects:  67% (31/46)        
remote: Counting objects:  69% (32/46)        
remote: Counting objects:  71% (33/46)        
remote: Counting objects:  73% (34/46)        
remote: Counting objects:  76% (35/46)        
remote: Counting objects:  78% (36/46)        
remote: Counting objects:  80% (37/46)        
remote: Counting objects:  82% (38/46)        
remote: Counting objects:  84% (39/46)        
remote: Counting objects:  86% (40/46)        
remote: Counting objects:  89% (41/46)        
remote: Counting objects:  91% (42/46)        
remote: Counting objects:  93% (43/46)        
remote: Counting objects:  95% (44/46)        
remote: Counting objects:  97% (45/46)        
remote: Counting objects: 100% (46/46)        
remote: Counting objects: 100% (46/46), done.        
remote: Compressing objects:   4% (1/22)        
remote: Compressing objects:   9% (2/22)        
remote: Compressing objects:  13% (3/22)        
remote: Compressing objects:  18% (4/22)        
remote: Compressing objects:  22% (5/22)        
remote: Compressing objects:  27% (6/22)        
remote: Compressing objects:  31% (7/22)        
remote: Compressing objects:  36% (8/22)        
remote: Compressing objects:  40% (9/22)        
remote: Compressing objects:  45% (10/22)        
remote: Compressing objects:  50% (11/22)        
remote: Compressing objects:  54% (12/22)        
remote: Compressing objects:  59% (13/22)        
remote: Compressing objects:  63% (14/22)        
remote: Compressing objects:  68% (15/22)        
remote: Compressing objects:  72% (16/22)        
remote: Compressing objects:  77% (17/22)        
remote: Compressing objects:  81% (18/22)        
remote: Compressing objects:  86% (19/22)        
remote: Compressing objects:  90% (20/22)        
remote: Compressing objects:  95% (21/22)        
remote: Compressing objects: 100% (22/22)        
remote: Compressing objects: 100% (22/22), done.        
remote: Total 25 (delta 20), reused 7 (delta 3), pack-reused 0        
From https://github.com/python/cpython
 * branch                  main       -> FETCH_HEAD
Note: switching to 'b2c1b4da1935639cb89fbbad0ce170a1182537bd'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at b2c1b4da19 gh-104389: Add 'unused' keyword to Argument Clinic C converters (#104390)
Switched to and reset branch 'main'

configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.

Fatal Python error: Segmentation fault

Thread 0x00007f974f0fa280 (most recent call first):
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/runner.py", line 74 in _write_status
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/runner.py", line 95 in addSuccess
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/testresult.py", line 122 in addSuccess
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/case.py", line 648 in run
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/case.py", line 690 in __call__
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 122 in run
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 122 in run
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 122 in run
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/runner.py", line 240 in run
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/__init__.py", line 1106 in _run_suite
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/__init__.py", line 1232 in run_unittest
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/runtest.py", line 294 in _test_module
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/runtest.py", line 330 in _runtest_inner2
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/runtest.py", line 373 in _runtest_inner
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/runtest.py", line 248 in _runtest
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/runtest.py", line 278 in runtest
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/main.py", line 365 in rerun_failed_tests
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/main.py", line 783 in _main
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/main.py", line 738 in main
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/main.py", line 802 in main
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/__main__.py", line 2 in <module>
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/runpy.py", line 88 in _run_code
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/runpy.py", line 198 in _run_module_as_main

Extension modules: _testcapi (total: 1)
Segmentation fault
make: *** [Makefile:1956: buildbottest] Error 139

Cannot open file '/root/buildarea/3.x.angelico-debian-amd64/build/test-results.xml' for upload
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

carljm added a commit to carljm/cpython that referenced this pull request May 12, 2023
@carljm
Merge branch 'main' into supermon
8efd7c6
* main:
  pythongh-91896: Fixup some docs issues following ByteString deprecation (python#104422)
  pythonGH-104371: check return value of calling `mv.release` (python#104417)
  pythongh-104415: Fix refleak tests for `typing.ByteString` deprecation (python#104416)
  pythonGH-86275: Implementation of hypothesis stubs for property-based tests, with zoneinfo tests (python#22863)
  pythonGH-103082: Filter LINE events in VM, to simplify tool implementation. (pythonGH-104387)
  pythongh-93649: Split gc- and allocation tests from _testcapimodule.c (pythonGH-104403)
  pythongh-104389: Add 'unused' keyword to Argument Clinic C converters (python#104390)
  pythongh-101819: Prepare _io._IOBase for module state (python#104386)
  pythongh-104413: Fix refleak when super attribute throws AttributeError (python#104414)
  Fix refleak in `super_descr_get` (python#104408)
  pythongh-87526: Remove dead initialization from _zoneinfo parse_abbr() (python#24700)
  pythongh-91896: Improve visibility of `ByteString` deprecation warnings (python#104294)
  pythongh-104371: Fix calls to `__release_buffer__` while an exception is active (python#104378)
  pythongh-104377: fix cell in comprehension that is free in outer scope (python#104394)
  pythongh-104392: Remove _paramspec_tvars from typing (python#104393)
  pythongh-104396: uuid.py to skip platform check for emscripten and wasi (pythongh-104397)
  pythongh-99108: Refresh HACL* from upstream (python#104401)
  pythongh-104301: Allow leading whitespace in disambiguated pdb statements (python#104342)
@JelleZijlstra JelleZijlstra mentioned this pull request May 22, 2023
PPC64LE RHEL8 3.x buildbot is timing out on test_gdb #104735
Closed
erlend-aasland added a commit to erlend-aasland/devguide that referenced this pull request Sep 8, 2023
@erlend-aasland
python/cpython#104389: Add 'unused' keyword to Argument Clinic C conv…
816a8be
…erters (python/cpython#104390)

Use the unused keyword param in the converter to explicitly
mark an argument as unused:

    /*[clinic input]
    SomeBaseClass.stubmethod
        flag: bool(unused=True)
    [clinic start generated code]*/
AA-Turner pushed a commit to AA-Turner/devguide that referenced this pull request Sep 13, 2023
@erlend-aasland
python/cpython#104389: Add 'unused' keyword to Argument Clinic C conv…
d8a7663
…erters (python/cpython#104390)

Use the unused keyword param in the converter to explicitly
mark an argument as unused:

    /*[clinic input]
    SomeBaseClass.stubmethod
        flag: bool(unused=True)
    [clinic start generated code]*/
erlend-aasland added a commit to python/devguide that referenced this pull request Sep 26, 2023
@erlend-aasland
python/cpython#104389: Add 'unused' keyword to Argument Clinic C conv…
9e49475
…erters (python/cpython#104390)

Use the unused keyword param in the converter to explicitly
mark an argument as unused:

    /*[clinic input]
    SomeBaseClass.stubmethod
        flag: bool(unused=True)
    [clinic start generated code]*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes
@corona10 corona10 corona10 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Make it possible to mark Argument Clinic args as unused

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@erlend-aasland @vstinner @bedevere-bot @corona10
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.