Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pybind11_stubgen/parser/mixins/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ def handle_function(self, path: QualifiedName, func: Any) -> list[Function]:
func_name = Identifier(path[-1])

try:
if type(func) is types.BuiltinFunctionType:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there is reason why you are not using isinstance

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good question. it looks like using isinstance() would actually cover a few additional types, such as types.BuiltinMethodType, which is probably a good thing.

raise TypeError
(
args,
var_args,
Expand Down