KEMBAR78
[mypyc] Make generated generator helper method internal by JukkaL · Pull Request #19268 · python/mypy · GitHub
Skip to content

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