Skip to content
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

Officially add Py_SETREF and Py_XSETREF #76164

Closed
serhiy-storchaka opened this issue Nov 8, 2017 · 5 comments
Closed

Officially add Py_SETREF and Py_XSETREF #76164

serhiy-storchaka opened this issue Nov 8, 2017 · 5 comments
Labels
3.7 (EOL) end of life docs Documentation in the Doc dir interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 31983
Nosy @rhettinger, @vstinner, @serhiy-storchaka

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2017-12-25.09:30:41.146>
created_at = <Date 2017-11-08.16:24:41.385>
labels = ['interpreter-core', 'type-feature', '3.7', 'docs']
title = 'Officially add Py_SETREF and Py_XSETREF'
updated_at = <Date 2017-12-25.09:30:41.144>
user = 'https://github.com/serhiy-storchaka'

bugs.python.org fields:

activity = <Date 2017-12-25.09:30:41.144>
actor = 'serhiy.storchaka'
assignee = 'docs@python'
closed = True
closed_date = <Date 2017-12-25.09:30:41.146>
closer = 'serhiy.storchaka'
components = ['Documentation', 'Interpreter Core']
creation = <Date 2017-11-08.16:24:41.385>
creator = 'serhiy.storchaka'
dependencies = []
files = []
hgrepos = []
issue_num = 31983
keywords = []
message_count = 5.0
messages = ['305878', '305888', '305889', '306284', '309033']
nosy_count = 4.0
nosy_names = ['rhettinger', 'vstinner', 'docs@python', 'serhiy.storchaka']
pr_nums = []
priority = 'normal'
resolution = 'rejected'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue31983'
versions = ['Python 3.7']

@serhiy-storchaka
Copy link
Member Author

Private macros Py_SETREF and Py_XSETREF were introduced in 3.6 and backported to all maintained versions for fixing bugs (see bpo-20440 and bpo-26200). They are helpful and used not only for the primary purpose, but also for simplifying the code. Their names don't start from underscore because I planned to make them public and didn't want massive renaming and backporting conflicts. Now I think it is a time to add them officially to the stable C API.

@serhiy-storchaka serhiy-storchaka added the 3.7 (EOL) end of life label Nov 8, 2017
@serhiy-storchaka serhiy-storchaka added docs Documentation in the Doc dir interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Nov 8, 2017
@skrah
Copy link
Mannequin

skrah mannequin commented Nov 8, 2017

Just adding +1.

@serhiy-storchaka
Copy link
Member Author

Does anyone want to propose a patch? This is mainly a documentation issue. Needed documenting Py_SETREF and Py_XSETREF in Doc/c-api/refcounting.rst, adding entries in Doc/whatsnew/3.7.rst, and "Misc/NEWS.d/next/C API/", and updating a guard in Include/object.h.

@rhettinger
Copy link
Contributor

Adding my -1. My experience was that these macros impaired my ability to maintain the code and interfered with useful patterns like delaying all decrefs until an object was in a consistent state.

While I know that name was bikeshedded quite a bit, the outcome is rather unintuitive: https://twitter.com/raymondh/status/930535938459025408

@serhiy-storchaka
Copy link
Member Author

Since there are objections, it is too early to make this a public C API.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7 (EOL) end of life docs Documentation in the Doc dir interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants