Skip to content

Add "how to" for the setter Argument Clinic directive - #1245

Merged
corona10 merged 17 commits into
python:mainfrom
corona10:ac-setter
Dec 13, 2023
Merged

Add "how to" for the setter Argument Clinic directive#1245
corona10 merged 17 commits into
python:mainfrom
corona10:ac-setter

Conversation

@corona10

@corona10corona10 commented Dec 10, 2023

Copy link
Copy Markdown
Member

Comment threaddevelopment-tools/clinic.rst Outdated
Comment threaddevelopment-tools/clinic.rst Outdated
Comment threaddevelopment-tools/clinic.rst Outdated
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@corona10
corona10 requested a review from hugovkDecember 11, 2023 06:50
Comment threaddevelopment-tools/clinic.rst Outdated
Comment threaddevelopment-tools/clinic.rst Outdated
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
@erlend-aasland

Copy link
Copy Markdown
Contributor

Hm, instead of having two how-to's -- one for @getter and one for @setter -- how about unifying them and creating a "How to declare PyGetSetDef functions"? After all, Argument Clinic's audience is (mainly) developers who are fairly comfortable with the C API.

@corona10corona10 reopened this Dec 11, 2023
@AlexWaygood

Copy link
Copy Markdown
Member

(I'm travelling right now, but will do my best to review this tomorrow or Wednesday!)

@erlend-aaslanderlend-aasland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some suggestions.

Comment threaddevelopment-tools/clinic.rst Outdated
Comment threaddevelopment-tools/clinic.rst Outdated
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Comment threaddevelopment-tools/clinic.rst Outdated
Comment threaddevelopment-tools/clinic.rst Outdated
Comment threaddevelopment-tools/clinic.rst Outdated
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Comment threaddevelopment-tools/clinic.rst Outdated
Comment threaddevelopment-tools/clinic.rst Outdated
Comment threaddevelopment-tools/clinic.rst Outdated
corona10and others added 2 commits December 13, 2023 10:18
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>

@AlexWaygoodAlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Some minor points:

Comment threaddevelopment-tools/clinic.rst Outdated
Comment threaddevelopment-tools/clinic.rst Outdated
Comment threaddevelopment-tools/clinic.rst Outdated
Comment on lines -2040 to -2041
And then the implementation will work the same as a Python method which is
decorated by :py:class:`property`.

@AlexWaygoodAlexWaygoodDec 13, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this should be deleted; the Python REPL example at the bottom now has no introduction explaining what it's illustrating

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I will supplement to the above descriptions.

@corona10corona10Dec 13, 2023

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. I think that "Getters" and "setters" are C functions defined in a :c:type:`PyGetSetDef` struct that facilitate :py:class:`property`-like access for a class will be enough for understand Python REPL..

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Comment threaddevelopment-tools/clinic.rst Outdated
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Comment threaddevelopment-tools/clinic.rst
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

@AlexWaygoodAlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@corona10
corona10 merged commit 47d44b3 into python:mainDec 13, 2023
@corona10
corona10 deleted the ac-setter branch December 13, 2023 14:03
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@corona10@erlend-aasland@AlexWaygood@hugovk@ezio-melotti