Skip to content

Conversation

inducer
Copy link

@inducer inducer commented May 22, 2025

Currently, stub generation mishandles the case where a method is actually a function imported from a different module. (It simply imports the name as the name of the method and calls it a day. A name never gets added to the class namespace.)

This can arise, for example, if one adds methods to nanobind-generated classes via monkeypatching.

Full disclosure: this is a bit of a drive-by PR. I did not investigate if/how type stubs are tested. If you'd like me to add testing or make other revisions, I would be happy to.

@inducer inducer marked this pull request as draft May 22, 2025 19:18
@inducer inducer mentioned this pull request May 22, 2025
12 tasks
@wjakob
Copy link
Owner

wjakob commented Jun 1, 2025

Could you please add a test that covers this new feature? You will also need to update the stub reference files.

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