Skip to content

Commit

Permalink
sagemathgh-38095: src/sage/algebras/steenrod/all.py: Use lazy_impor…
Browse files Browse the repository at this point in the history
…t, remove deprecated global import

    
<!-- ^ 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". -->

- The change to use `lazy_import` was cherry-picked from sagemath#37900
- The global import was deprecated in sagemath#32647 (2021)

### 📝 Checklist

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

- [x] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [x] 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

<!-- 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#38095
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee
  • Loading branch information
Release Manager committed May 31, 2024
2 parents dfb90d0 + d78a132 commit da885cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sage/algebras/steenrod/all.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# sage_setup: distribution = sagemath-combinat
"""
The Steenrod algebra
"""
from sage.algebras.steenrod.steenrod_algebra import SteenrodAlgebra, Sq
from sage.misc.lazy_import import lazy_import
lazy_import('sage.algebras.steenrod.steenrod_algebra_bases',
'steenrod_algebra_basis',
deprecation=(32647, 'removed from namespace'))
lazy_import('sage.algebras.steenrod.steenrod_algebra', ['SteenrodAlgebra', 'Sq'])
del lazy_import
2 changes: 2 additions & 0 deletions src/sage/misc/sageinspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,7 @@ def sage_getfile(obj):
sage: from sage.misc.sageinspect import sage_getfile
sage: sage_getfile(sage.rings.rational)
'...sage/rings/rational.pyx'
sage: from sage.algebras.steenrod.steenrod_algebra import Sq # needs sage.combinat sage.modules
sage: sage_getfile(Sq) # needs sage.combinat sage.modules
'...sage/algebras/steenrod/steenrod_algebra.py'
sage: sage_getfile(x) # needs sage.symbolic
Expand Down Expand Up @@ -1358,6 +1359,7 @@ def sage_getfile_relative(obj):
sage: from sage.misc.sageinspect import sage_getfile_relative
sage: sage_getfile_relative(sage.rings.rational)
'sage/rings/rational.pyx'
sage: from sage.algebras.steenrod.steenrod_algebra import Sq # needs sage.combinat sage.modules
sage: sage_getfile_relative(Sq) # needs sage.combinat sage.modules
'sage/algebras/steenrod/steenrod_algebra.py'
sage: sage_getfile_relative(x) # needs sage.symbolic
Expand Down

0 comments on commit da885cf

Please sign in to comment.