Skip to content
Merged
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
Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
  • Loading branch information
corona10 and hugovk authored Dec 11, 2023
commit 17d0f4dbcb807fd56f492e95ceb64a10329df2bc
5 changes: 3 additions & 2 deletions development-tools/clinic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2000,12 +2000,13 @@ The generated glue code looks like this:
.. versionadded:: 3.13


.. _clinic-howto-getter:
.. _clinic-howto-getter-setter:
Comment thread
corona10 marked this conversation as resolved.
Outdated

How to generate a getter
------------------------

"Getters" and "Setters" are C functions that facilitate property-like access for a class.
"Getters" and "setters" are C functions that facilitate property-like access for a class.
See :c:type:`getter <PyGetSetDef>` and :c:type:`setter <PyGetSetDef>` for details.
You can use the ``@getter`` and ``@setter`` directive to generate an "impl" function for a
getter using Argument Clinic.
Expand Down Expand Up @@ -2053,7 +2054,7 @@ The generated glue code looks like this:
return return_value;
}

Note that each of ``@getter`` and ``@setter`` should be declared at separated definitions.
Note that each of ``@getter`` and ``@setter`` should be declared in separated definitions.
Comment thread
corona10 marked this conversation as resolved.
Outdated
And then the implementation will work the same as a Python method which is
decorated by :py:class:`property`.
Comment thread
corona10 marked this conversation as resolved.
Outdated

Comment thread
corona10 marked this conversation as resolved.
Expand Down