Skip to content

Don't allow keep_alive or call_guard on properties #5533

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gentlegiantJGC
Copy link
Contributor

@gentlegiantJGC gentlegiantJGC commented Feb 18, 2025

Description

The def_property family blindly ignore the keep_alive and call_guard arguments passed to them making them confusing to use.
This adds a static_assert if either is passed to make it clear it doesn't work.
I would prefer this to be a compiler warning but I can't find a way to do that. Is that even possible?

This does not fix - #4236 or #5046 but makes it clear that they don't work.

Suggested changelog entry:

Stop keep_alive and call_guard being passed to def_property functions.

gentlegiantJGC and others added 2 commits February 18, 2025 12:27
The def_property family blindly ignore the keep_alive and call_guard arguments passed to them making them confusing to use.
This adds a static_assert if either is passed to make it clear it doesn't work.
I would prefer this to be a compiler warning but I can't find a way to do that. Is that even possible?
@rwgk
Copy link
Collaborator

rwgk commented Feb 26, 2025

(random timing, I'm cleaning up my email backlog)

Looks good, thanks! — 'll get back here a few days after #5542 is merged, but before the v3.0.0 release.

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.

2 participants