8000 gh-112205: Support docstring for `@getter` by corona10 · Pull Request #113160 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-112205: Support docstring for @getter #113160

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

Merged
merged 12 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Resolve regression
  • Loading branch information
corona10 committed Dec 15, 2023
commit bc2ee26d5ce58fa5e42f5e165469509b3dbabc31
23 changes: 15 additions & 8 deletions Lib/test/clinic.test.c
Original file line number Diff line number Diff line change
Expand Up @@ -4956,14 +4956,16 @@ Test_meth_coexist_impl(TestObj *self)
Test.property
[clinic start generated code]*/

PyDoc_STRVAR(Test_property__doc__,
"");

#if defined(Test_property_HAS_DOCSTR)
# define Test_property_DOCSTR Test_property__doc__
#else
# define Test_property_DOCSTR NULL
#endif
#if defined(TEST_PROPERTY_GETSETDEF)
# undef TEST_PROPERTY_GETSETDEF
# define TEST_PROPERTY_GETSETDEF {"property", (getter)Test_property_get, (setter)Test_property_set, Test_property__doc__},
# define TEST_PROPERTY_GETSETDEF {"property", (getter)Test_property_get, (setter)Test_property_set, Test_property_DOCSTR},
#else
# define TEST_PROPERTY_GETSETDEF {"property", (getter)Test_property_get, NULL, Test_property__doc__},
# define TEST_PROPERTY_GETSETDEF {"property", (getter)Test_property_get, NULL, Test_property_DOCSTR},
#endif

static PyObject *
Expand All @@ -4977,16 +4979,21 @@ Test_property_get(TestObj *self, void *Py_UNUSED(context))

static PyObject *
Test_property_get_impl(TestObj *self)
/*[clinic end generated code: output=6066ef293041bb7f input=2d92b3449fbc7d2b]*/
/*[clinic end generated code: output=1bfac7190f65014a input=2d92b3449fbc7d2b]*/

/*[clinic input]
@setter
Test.property
[clinic start generated code]*/

#if defined(TEST_PROPERTY_HAS_DOCSTR)
# define Test_property_DOCSTR Test_property__doc__
#else
# define Test_property_DOCSTR NULL
#endif
#if defined(TEST_PROPERTY_GETSETDEF)
# undef TEST_PROPERTY_GETSETDEF
# define TEST_PROPERTY_GETSETDEF {"property", (getter)Test_property_get, (setter)Test_property_set, Test_property__doc__},
# define TEST_PROPERTY_GETSETDEF {"property", (getter)Test_property_get, (setter)Test_property_set, Test_property_DOCSTR},
#else
# define TEST_PROPERTY_GETSETDEF {"property", NULL, (setter)Test_property_set, NULL},
#endif
Expand All @@ -5002,7 +5009,7 @@ Test_property_set(TestObj *self, PyObject *value, void *Py_UNUSED(context))

static int
Test_property_set_impl(TestObj *self, PyObject *value)
/*[clinic end generated code: output=06bfbaf593f8b62b input=3bc3f46a23c83a88]*/
/*[clinic end generated code: output=44050814a89e3dc5 input=3bc3f46a23c83a88]*/

/*[clinic input]
output push
Expand Down
38 changes: 22 additions & 16 deletions Modules/_io/clinic/bufferedio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 22 additions & 16 deletions Modules/_io/clinic/stringio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

99 changes: 66 additions & 33 deletions Modules/_io/clinic/textio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
0