Remove current module from nested types#272
Closed
gentlegiantJGC wants to merge 1 commit intopybind:masterfrom
Closed
Remove current module from nested types#272gentlegiantJGC wants to merge 1 commit intopybind:masterfrom
gentlegiantJGC wants to merge 1 commit intopybind:masterfrom
Conversation
* Remove current module from nested types Types like union types have nested types in them. The current implementation only removes the current module name from the root type name. This modifies that behaviour so that it expands nested types recursively. * Add tests * Reorder variant types pybind11 requires that arguments are default constructable but Foo is not * Reorder types in union * Add nested types to all * Add missing stubs
Contributor
|
Oh I had a couple of issues like these recently and started patching around. Thank you for the fix @gentlegiantJGC! Can you please rebase against |
Contributor
|
Per #266 (comment), the PR in #263 might be the simpler fix. |
This was referenced Jan 22, 2026
Contributor
|
Moved into #280 |
ax3l
added a commit
to juelg/pybind11-stubgen
that referenced
this pull request
Jan 22, 2026
Fixes pybind#266 Fixes pybind#272 Takes the tests from pybind#272 and the simple fix from the large PR in pybind#263. Credits to @gentlegiantJGC and @sarlinpe 🙏 --------- Co-authored-by: gentlegiantJGC <gentlegiantJGC@users.noreply.github.com> Co-authored-by: sarlinpe <paul.edouard.sarlin@gmail.com> Co-authored-by: Skarn <skarnproject@gmail.com>
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.
Types like union types have nested types in them.
The current implementation only removes the current module name from the root type name.
This modifies that behaviour so that it expands nested types recursively.
I discovered this through a mypy error that the module had not been imported.
Current behaviour
Expected behaviour