You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gh-35275: Drinfeld modules: Make some imports lazy
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes#1234" use "Introduce new method to
calculate 1+1"
-->
### 📚 Description
<!-- Describe your changes here in detail -->
We replace some `import`s by `lazy_imports` in
`sage.categories.drinfeld_modules` and make the import of
`DrinfeldModule` into the global namespace lazy. We also move the
module-level import of `PolynomialBaseringInjection` in
`sage.rings.polynomial.polynomial_ring` into a method.
<!-- Why is this change required? What problem does it solve? -->
`git grep '^from sage.rings' src/sage/categories` reveals that the
recently added `.drinfeld_modules` is the only module that imports
nontrivial things from `sage.rings`. This is a new obstacle to
modularization (it caused an error due to import cycles in #35095.)
The purpose of reducing the module-level import to a method-level import
is explained in https://doc.sagemath.org/html/en/developer/packaging_sag
e_library.html#module-level-runtime-dependencies
<!-- If it resolves an open issue, please link to the issue here. For
example "Closes#1337" -->
### 📝 Checklist
<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
- [x] I have made sure that the title is self-explanatory and the
description concisely explains the PR.
- [ ] I have linked an issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.
### ⌛ Dependencies
<!-- List all open pull requests that this PR logically depends on -->
<!--
- #xyz: short description why this is a dependency
- #abc: ...
-->
URL: #35275
Reported by: Matthias Köppe
Reviewer(s): Antoine Leudière, Matthias Köppe
0 commit comments