Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit non-primitive return type in callback #20

Closed
mara004 opened this issue Jan 19, 2025 · 3 comments
Closed

Revisit non-primitive return type in callback #20

mara004 opened this issue Jan 19, 2025 · 3 comments

Comments

@mara004
Copy link
Member

mara004 commented Jan 19, 2025

In retrospect, I think remapping a non-primitive pointer type to c_void_p, as the UNCHECKED() wrapper did, actually seems right. I probably was subject to a misunderstanding back then.

However, it would be great if we could do this directly at bindings construction time, rather than through a runtime wrapper in the bindings.

Also, a real-world example would be great for testing.

@mara004 mara004 changed the title Non-primitive return type in callback revisited Revisit non-primitive return type in callback Jan 19, 2025
@mara004
Copy link
Member Author

mara004 commented Jan 19, 2025

Note, historically, the UNCHECKED() wrapper caused a bug during the python 2 -> 3 migration: ctypesgen#70 ctypesgen#73

That's not relevant anymore, but it hints that templates tend to be wonky, which is part of the reason why I'd prefer to avoid them...

@mara004
Copy link
Member Author

mara004 commented Jan 31, 2025

OK, I think I added back a corrected verison of the UNCHECKED wrapper.
See ctypesgen#70 (comment) for what I changed.

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

No branches or pull requests

1 participant