sagemath/sage

sage.structure: Remove some module-level imports

Closed this issue · 17 comments

Depends on #29892
Depends on #29873

CC: @tscrim

Component: refactoring

Author: Matthias Koeppe

Branch/Commit: a75ea75

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/29883

New commits:

5fe64b1sage.structure.factorization: Make import of sage.rings.integer.Integer local to methods
eb841desage.structure.sequence: Make import of sage.misc.latex local to the latex method
e45b305sage.structure.factorization: Make import of sage.misc.misc_c.prod local to methods
d353497sage.structure.formal_sum, .parent_gens: Fixup: Remove imports

Commit: d353497

comment:3

These are all okay with me. I am very slightly worried about the Factorization.__pow__, but I doubt anyone is calling that in a sufficiently tight loop for the import to affect that, unless you are calling x^0 or x^1 a lot with x being a factorization. So it is probably fine.

Green patchbot => positive review.

Dependencies: #29892

Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:

a5453bfFixup: Add src/sage/misc/call.py
64c5701lazy_import from sage.misc.call with deprecation
65414f7Fix imports and one deprecation warning
b9314d4sage.misc.call: Add standard header information, add to reference manual
6024ffdsrc/sage/misc/call.py: register_unpickle_override for call_method
ab4e0fdMove sage.misc.misc.coeff_repr, repr_lincomb to new module sage.misc.repr
07e0baasage.structure.parent_gens: Remove imports
646042bsage.structure.sequence: Make import of sage.misc.latex local to the latex method
6517828sage.structure.factorization: Make import of sage.rings.integer.Integer local to methods
54fabfcsage.structure.factorization: Make import of sage.misc.misc_c.prod local to methods

Changed commit from d353497 to 54fabfc

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

3f5b6eaMove sage.misc.misc.coeff_repr, repr_lincomb to new module sage.misc.repr
97199ddsage.structure.parent_gens: Remove imports
bb4c6a8sage.structure.sequence: Make import of sage.misc.latex local to the latex method
0820283sage.structure.factorization: Make import of sage.rings.integer.Integer local to methods
7991b64sage.structure.factorization: Make import of sage.misc.misc_c.prod local to methods

Changed commit from 54fabfc to 7991b64

Changed dependencies from #29892 to #29892, #29873

Changed commit from 7991b64 to a75ea75

Branch pushed to git repo; I updated commit sha1. New commits:

08fedfasrc/sage/combinat/root_system/type_dual.py: Remove unused variable to fix pyflakes warning
05efc11sage.misc.repr.coeff_repr: Add doctest, adapted from sage.misc.latex.coeff_repr
538323bsrc/sage/misc/call.py: Fix block syntax in docstring
b5f63a5src/sage/misc/call.py: Returns should be Return
2c77d17Merge branch 't/29892/move_sage_misc_misc_coeff_repr__repr_lincomb_to_new_module_sage_misc_repr' into t/29883/sage_structure__remove_some_module_level_imports
f3afd30sage.categories.crystals: Make import of sage.misc.latex local to a method
6433a56sage.categories: Make imports from sage.rings, .sets, .combinat, .plot, .matrix local to methods
5c20de7Merge branch 't/16351/move_searchforest_code_to_sage_sets_recursively_enumerated_set_pyx' into t/29873/sage_categories_remove_module_level_imports
27f2dabsrc/sage/misc/call.py: Add coding directive
a75ea75Merge branch 't/29873/sage_categories_remove_module_level_imports' into t/29883/sage_structure__remove_some_module_level_imports
comment:11

Merged in some tickets to take care of (unrelated) patchbot warnings

comment:12

Green patchbot => positive review.

Reviewer: Travis Scrimshaw

comment:13

this pyflakes warning looks like an actual bug to me (not from changes on this ticket)

src/sage/categories/finite_dimensional_algebras_with_basis.py:1449:29 undefined name 'x'

... that should be fixed on another ticket.