Skip to content

Conversation

jabraham17
Copy link
Member

@jabraham17 jabraham17 commented Mar 24, 2025

Adds the ability to create anonymous Python modules, i.e. the user no longer needs to supply a module name, we automatically generate a unique one.

To support this, this PR deprecates importModule with two arguments and renames it to createModule, then adds a single argument overload of createModule that uses a per-interpreter counter to generate unique names.

Resolves #26943

Ran start_test test/library/packages/Python/ to validate the changes

[Reviewed by @lydia-duncan]

Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
@jabraham17 jabraham17 requested a review from lydia-duncan March 24, 2025 23:46
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Copy link
Member

@lydia-duncan lydia-duncan left a comment

Choose a reason for hiding this comment

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

Just a minor quibble about the location of the deprecation test, otherwise I think this is good to go!

Signed-off-by: Jade Abraham <[email protected]>
@jabraham17 jabraham17 merged commit 50bdcd1 into chapel-lang:main Mar 25, 2025
9 checks passed
@jabraham17 jabraham17 deleted the add-anon-modules branch March 25, 2025 16:20
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.

[Feature Request]: support importing anonymous Python modules
2 participants