Skip to content

Conversation

@nbruin
Copy link
Contributor

@nbruin nbruin commented Dec 16, 2025

Warn about not importing from all and instead use import_statements to figure out where to import from instead.

Fixes #41213

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Warn about not importing from all and instead use `import_statements` to figure out where to import from instead.
@github-actions
Copy link

Documentation preview for this PR (built with commit bbbbf60; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@user202729
Copy link
Contributor

user202729 commented Dec 17, 2025

We have .. WARNING::, but this part doesn't get rendered to HTML page anyway.

caveat: it isn't entirely clear this is what this module is meant to be. That said, it is true that the general direction is for imports in the Sage library to not import from this module.

@nbruin
Copy link
Contributor Author

nbruin commented Dec 17, 2025

it isn't entirely clear this is what this module is meant to be.

It's the global namespace for the interactive prompt. Hence the definition of sage_globals in there that captures the global namespace of that module. It has some other configuration of the interactive state as well.

vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 20, 2025
sagemathgh-41302: Add warning about imports to all.py
    
Warn about not importing from all and instead use `import_statements` to
figure out where to import from instead.

<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Fixes sagemath#41213


### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#41302
Reported by: nbruin
Reviewer(s):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LazyImport is breaking my personal modules

2 participants