Skip to content

Conversation

@ian-coccimiglio
Copy link
Contributor

This PR tries to more closely mirror how Python behaves with module imports. If script_globals and script_locals differ, then global imports will NOT work in parsed code.

I added a test-case to ensure this functions as expected.

Scijava variables are still considered local variables and need to be explicitly imported.

Resolves scijava/scripting-python#3

@ctrueden
Copy link
Member

Not sure why the CI didn't run, but tests are passing for me locally, so ✔️ !

@ctrueden ctrueden merged commit 07f3af0 into scijava:main Mar 21, 2025
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.

Python functions in a script do not inherit enclosing scope

2 participants