gh-112069: Adapt set/frozenset methods to Argument Clinic by tomasr8 · Pull Request #115112 · python/cpython

added 4 commits

February 6, 2024 23:52

aisk

@tomasr8 @aisk

Co-authored-by: AN Long <aisk@users.noreply.github.com>

@tomasr8 tomasr8 marked this pull request as ready for review

February 7, 2024 12:16

erlend-aasland

erlend-aasland

erlend-aasland

@tomasr8

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>

erlend-aasland

@erlend-aasland erlend-aasland changed the title gh-112069: Convert set/frozenset methods to Argument Clinic gh-112069: Adapt set/frozenset methods to Argument Clinic

Feb 8, 2024

erlend-aasland

@tomasr8 @erlend-aasland

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>

@tomasr8

@tomasr8

erlend-aasland

@tomasr8 @erlend-aasland

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>

erlend-aasland

@tomasr8

@tomasr8 tomasr8 deleted the setobject-argument-clinic branch

February 8, 2024 16:50

fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request

Feb 14, 2024

skirpichev added a commit to skirpichev/cpython that referenced this pull request

Oct 28, 2024
Current patch partially address issue, working in case when all
arguments either positional-only or vararg.

This also converts gcd(), lcm() and hypot() functions of the math module
to the Argument Clinic.  Fix issue python#101123.

Objects/setobject.c and Modules/gcmodule.c adapted.  This fixes slight
performance regression for set methods, introduced by
python#115112:

| Benchmark            | ref    | patch                |
|----------------------|:------:|:--------------------:|
| set().update(s1, s2) | 354 ns | 264 ns: 1.34x faster |

Benchmark code:
```py
import pyperf
s1, s2 = {1}, {2}
runner = pyperf.Runner()
runner.bench_func('set().update(s1, s2)', set().update, s1, s2)
```

erlend-aasland pushed a commit that referenced this pull request

Oct 31, 2024
…#126064)

Avoid temporary tuple creation when all arguments either positional-only
or vararg.

Objects/setobject.c and Modules/gcmodule.c adapted. This fixes slight
performance regression for set methods, introduced by gh-115112.

picnixz pushed a commit to picnixz/cpython that referenced this pull request

Dec 8, 2024
…arargs (python#126064)

Avoid temporary tuple creation when all arguments either positional-only
or vararg.

Objects/setobject.c and Modules/gcmodule.c adapted. This fixes slight
performance regression for set methods, introduced by pythongh-115112.

ebonnal pushed a commit to ebonnal/cpython that referenced this pull request

Jan 12, 2025
…arargs (python#126064)

Avoid temporary tuple creation when all arguments either positional-only
or vararg.

Objects/setobject.c and Modules/gcmodule.c adapted. This fixes slight
performance regression for set methods, introduced by pythongh-115112.