8000 Add "how to" for the getter Argument Clinic directive. by corona10 · Pull Request #1232 · python/devguide · GitHub
[go: up one dir, main page]

Skip to content

Add "how to" for the getter Argument Clinic directive. #1232

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 16 commits into from
Nov 30, 2023
Merged
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
corona10 committed Nov 30, 2023
commit 45a72503314f35b5eb0689afe9f8eebfa79b25f3
4 changes: 2 additions & 2 deletions development-tools/clinic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,7 @@ How to generate a getter
------------------------

You can use the ``@getter`` directive to generate an "impl" function
that defines a :c:func:`getter <PyGetSetDef>`.
that defines a `getter <https://docs.python.org/3/c-api/structures.html#c.PyGetSetDef>`_.

This example --- taken from :cpy-file:`Modules/_io/bufferedio.c` ---
shows the use of ``@getter`` in combination with
Expand Down Expand Up @@ -2037,7 +2037,7 @@ The generated glue code looks like this:
}

And then the implementation will work the same as the Python method which is
decorated by :meth:`property.getter`.
decorated by `property <https://docs.python.org/3/library/funtions.html#property>`_.

.. code-block:: python

Expand Down
0