From db2f44c247e11fcfa31546eef5622172e30de62a Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sat, 16 Dec 2023 18:34:50 +0900 Subject: [PATCH 1/3] Add explanation about docstring for PyGetSetDef --- development-tools/clinic.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/development-tools/clinic.rst b/development-tools/clinic.rst index c2b18f4a2e..ddc4d42fd6 100644 --- a/development-tools/clinic.rst +++ b/development-tools/clinic.rst @@ -2087,6 +2087,8 @@ The generated glue code looks like this: Getters and setters must be declared as separate functions. The *value* parameter for a "setter" is added implicitly by Argument Clinic. + The docstring is also supported for :c:type:`PyGetSetDef` functions like other + but it must be declared at ``@getter``. And then the implementation will work the same as a Python method which is decorated by :py:class:`property`: From 149a8f2fede1f819e07949b65149331c6ff5078b Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sat, 16 Dec 2023 18:37:42 +0900 Subject: [PATCH 2/3] nit --- development-tools/clinic.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/development-tools/clinic.rst b/development-tools/clinic.rst index ddc4d42fd6..986fd36a0d 100644 --- a/development-tools/clinic.rst +++ b/development-tools/clinic.rst @@ -2087,8 +2087,8 @@ The generated glue code looks like this: Getters and setters must be declared as separate functions. The *value* parameter for a "setter" is added implicitly by Argument Clinic. - The docstring is also supported for :c:type:`PyGetSetDef` functions like other - but it must be declared at ``@getter``. + The docstring is also supported for :c:type:`PyGetSetDef` functions like + other methods, but it must be declared at ``@getter``. And then the implementation will work the same as a Python method which is decorated by :py:class:`property`: From 2780e41f290d7954bdc4c3a45564939099808ac4 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sat, 16 Dec 2023 23:02:31 +0900 Subject: [PATCH 3/3] Update development-tools/clinic.rst Co-authored-by: Ezio Melotti --- development-tools/clinic.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/development-tools/clinic.rst b/development-tools/clinic.rst index 986fd36a0d..910de404ac 100644 --- a/development-tools/clinic.rst +++ b/development-tools/clinic.rst @@ -2087,8 +2087,8 @@ The generated glue code looks like this: Getters and setters must be declared as separate functions. The *value* parameter for a "setter" is added implicitly by Argument Clinic. - The docstring is also supported for :c:type:`PyGetSetDef` functions like - other methods, but it must be declared at ``@getter``. + It is possible to create a docstring for the property by adding it to + the ``@getter``. And then the implementation will work the same as a Python method which is decorated by :py:class:`property`: