-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Clinic causes compiler warnings when using a getter and setter with a docstring #127341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
build
The build process and cross-build
topic-argument-clinic
type-bug
An unexpected behavior, bug, or error
Comments
erlend-aasland
added a commit
that referenced
this issue
Nov 29, 2024
…cstrings (#127310) Co-authored-by: Erlend E. Aasland <erlend@python.org>
ZeroIntensity
added a commit
to ZeroIntensity/cpython
that referenced
this issue
Nov 29, 2024
…tters with docstrings (pythonGH-127310) (cherry picked from commit 9949091) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Erlend E. Aasland <erlend@python.org>
erlend-aasland
added a commit
that referenced
this issue
Nov 30, 2024
Thanks, Peter! |
This was referenced Dec 14, 2024
srinivasreddy
pushed a commit
to srinivasreddy/cpython
that referenced
this issue
Jan 8, 2025
…ith docstrings (python#127310) Co-authored-by: Erlend E. Aasland <erlend@python.org>
ebonnal
pushed a commit
to ebonnal/cpython
that referenced
this issue
Jan 12, 2025
…ith docstrings (python#127310) Co-authored-by: Erlend E. Aasland <erlend@python.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
build
The build process and cross-build
topic-argument-clinic
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
I noticed this while working on GH-126890, as some odd macro redefinition warnings came up from the generated clinic file. As it turns out, clinic has a bug where using both
@getter
and@setter
where the getter has a docstring doesn't work correctly. Quick reproducer:This results in generated code that looks like this:
There's two bugs here:
HAS_DOCSTR
part; it usesTEST_TEST_HAS_DOCSTR
whileTest_test_HAS_DOCSTR
, so the resulting docstring ends up being redefined to NULL.The simplest fix is to just drop the
HAS_DOCSTR
entirely, and just check whether the actualDOCSTR
macro is defined or not, and then set it toNULL
in that case (thanks @erlend-aasland for this suggestion).I've created GH-127310 as a fix.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: