[v636] Backports of recent fixes#21910
Merged
guitargeek merged 3 commits intoroot-project:v6-36-00-patchesfrom Apr 14, 2026
Merged
[v636] Backports of recent fixes#21910guitargeek merged 3 commits intoroot-project:v6-36-00-patchesfrom
guitargeek merged 3 commits intoroot-project:v6-36-00-patchesfrom
Conversation
(cherry picked from commit b6e1ee4)
(cherry picked from commit 1e4bcdf)
Guard the automatic size() -> __len__ pythonization to require that size() returns an integer type and the class has begin()/end() methods or operator[]. This prevents bool() returning False for valid objects whose size() returns non-integer types like std::optional<std::size_t>. Use Cppyy::IsIntegerType (backed by Clang's QualType) to check the return type, which correctly resolves typedefs like size_type. Walk the MRO when checking for size/begin/end/getitem attributes, since HasAttrDirect only checks the class's own __dict__. Skip pythonization if size() has multiple overloads. Update tests for stl_like_class2/3 which have incomplete container interfaces (missing iterators or returning non-iterator types from begin/end). (cherry picked from commit cccbacc)
Test Results 18 files 18 suites 2d 14h 2m 29s ⏱️ For more details on these failures, see this check. Results for commit 2dac23f. ♻️ This comment has been updated with latest results. |
2d32dbf
into
root-project:v6-36-00-patches
36 of 41 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backporting the following two PRs: