Skip to content

Argument Clinic: document deletion of an attribute and @deleter - #1886

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:clinic-deleter
Aug 19, 2026
Merged

Argument Clinic: document deletion of an attribute and @deleter#1886
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:clinic-deleter

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 19, 2026

Copy link
Copy Markdown
Member

The setter generated by Argument Clinic is called with NULL to delete the attribute, and by default it rejects the deletion with an AttributeError. The @deleter directive, applied to the @setter, lets the implementation handle the deletion. Neither was documented.

The example of the generated code is also updated -- it was written before the accessors started to take PyObject *self.

Also update the example of the generated code.
@read-the-docs-community

read-the-docs-community Bot commented Aug 19, 2026

Copy link
Copy Markdown

Comment thread development-tools/clinic/howto.rst Outdated
Co-authored-by: Petr Viktorin <encukou@gmail.com>
@serhiy-storchaka
serhiy-storchaka merged commit 708aa7c into python:main Aug 19, 2026
5 checks passed
@serhiy-storchaka
serhiy-storchaka deleted the clinic-deleter branch August 19, 2026 18:56
Sign up for free to 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.

3 participants