Repository navigation
Fix property docstrings - #6252
gentlegiantJGC wants to merge 12 commits into
Conversation
|
All the CI failures seem to be ubuntu network errors |
Pybind11 does not mark properties as is_method leading to self in the docstring being arg0
f03208e to
c1beb7e
Compare
|
Both failures are unrelated build issues |
|
Here's a fairly quick AI review. Our CI is pretty overloaded at the moment, so I'll probably come back to this tonight or tomorrow. 🤖 AI text below 🤖 The review of PR #6252 found 7 issues. All of them are about test coverage, API design, missing docs or style. None is a definite crash or miscompile. Design (
User-visible change
Tests (
I recommend that the author fix items 2, 4 and 5 before merge. Items 1 and 3 are worth suggesting, and 6 and 7 are style. I can draft a review comment for the PR, or make these changes on the branch. |
|
After trying to understand point 1 I understand the issue a little better. Patching in |
|
Those commits should fix issues 2, 5 and 7 I have added a test case for a cpp_function property which should fail. |
|
You don't need to fix every issue from an AI review, that's one of the reasons it's marked as an AI review. I noticed that 4 was technically wrong before pasting it, though the current one is a bit short and unclear; that's fine though, I often modify them after merging. "Property docstrings use self more often." might be more accurate. I think this is fine for now; a solution for cpp_function would be a large change. |
|
I'll push a fix for older compilers. |
…tring The lambda constructor accepted std::nullptr_t, which made calls with nullptr and extras ambiguous on GCC 8/9. Also update the late-arg strdup comment, and mark the user-supplied cpp_function docstring case as a known limitation. Assisted-by: ClaudeCode:claude-opus-5-5
|
Your AI edit removed one of the failing tests |
Description
Pybind11 does not mark all properties as is_method leading to self in the docstring being arg0
def_readwriteanddef_readonlyare correctly marked asis_methodbut other variants are not.This only applies to lambdas and pointers passed into the def_property family.
If a user passes cpp_function it is their responsibility to mark as is_method.
Suggested changelog entry:
📚 Documentation preview 📚: https://pybind11--6252.org.readthedocs.build/