Closed
Description
Bug report
Bug description:
Found while working on #127946
This is sort of an extension to #127341, but not the exact same issue. If you define a setter before a getter, and then that getter has a docstring, a macro redefinition warning will occur, because the setter code sets the docstring to NULL
.
Quick repro:
/*[clinic input]
@setter
Test.test
[clinic start generated code]*/
/*[clinic input]
@getter
Test.test
my silly docstring
[clinic start generated code]*/
The simplest fix is to just #undef
the DOCSTR
macro in the getter if it's been defined already. I have a PR at #127950.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux