gh-113318: Better implementation of @getter and @setter in Argument Clinic - #156066
Open
serhiy-storchaka wants to merge 3 commits into
Open
gh-113318: Better implementation of @getter and @setter in Argument Clinic#156066serhiy-storchaka wants to merge 3 commits into
serhiy-storchaka wants to merge 3 commits into
Conversation
…ment Clinic The value of a @Setter is now a parameter, which can use a converter, and a @Getter can define a return converter. Declaring the value is optional. The accessors of an attribute are now collected in a Property, so the entry of PyGetSetDef is identified by the Python name instead of the C basename, and is composed without the help of the preprocessor unless some accessor is compiled conditionally.
serhiy-storchaka
requested review from
1st1,
AA-Turner,
asvetlov,
erlend-aasland,
gpshead,
kumaraditya303,
markshannon,
picnixz and
willingc
as code owners
August 19, 2026 19:44
…set-rework # Conflicts: # Tools/clinic/libclinic/dsl_parser.py # Tools/clinic/libclinic/parse_args.py
Member
|
Thanks. I won't have time this week for a line-by-line review, but at first glance this looks good. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to GH-155778.
@setteris now a parameter, so it can use a converter, and a@gettercan define a return converter. It is optional to declare the value:value: objectis added implicitly, with the defaultNULLif@deleteris applied.Property, indexed by the Python name, so the entry ofPyGetSetDefis identified by the Python name instead of the C basename. The accessors can therefore use different C basenames, and several implementations of the same accessor can be defined in different preprocessor conditional blocks.Some setters and getters of
_ssl,_asyncio,_ctypes,_sqlite3andfunction.__type_params__now use converters. The error for a wrong type of the value names the attribute instead of an argument of a function:@getterand@setter#113318