Skip to content

[mypyc] Make generated generator helper method internal #19268

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

Merged
merged 1 commit into from
Jun 10, 2025

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jun 10, 2025

Add a flag to FuncIR to allow functions to be marked as internal. Don't generate wrapper functions/methods that allow calls from Python for internal methods, since these are internal implementation details.

This has these benefits:

  • Internal functions are private and don't pollute public namespaces.
  • Signatures of generated functions can use arbitrary C types (e.g. arbitrary pointer types), even those that can't be passed to/from Python.
  • We generate less C code (fewer wrapper functions).

Add a flag to FuncIR to allow functions to be marked as internal.  Don't
generate wrapper functions/methods that allow calls from Python for
internal methods, since these are internal implementation details.

This has these benefits:
 * Internal functions are private and don't pollute public namespaces.
 * Signatures of generated functions can use arbitrary C types
   (e.g. arbitrary pointer types), even those that can't be passed
   to/from Python.
 * We generate less C code (fewer wrapper functions).
@JukkaL JukkaL merged commit 183fc96 into master Jun 10, 2025
13 checks passed
@JukkaL JukkaL deleted the mypyc-internal-helper branch June 10, 2025 15:03
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