Don't allow keep_alive or call_guard on properties#5533
Conversation
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?
|
(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. |
|
Looks like this got missed |
|
Oh, sorry. Could you please update this branch and tag me if you see that the CI passed? |
|
I think the android runner is broken. This is also an issue in #5896 |
|
Ignoring, after two unsuccessful reruns: CIBW / Android wheel ubuntu-latest (pull_request) (pull_request)Failing after 10m |
|
@gentlegiantJGC Thank you so much for the guard rails! Just to check the update path for this: should we use a syntax with |
The only cases this change should break are cases where |


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: