diff --git a/src/sage/arith/all.py b/src/sage/arith/all.py index c93e9f05bc9..3446336de68 100644 --- a/src/sage/arith/all.py +++ b/src/sage/arith/all.py @@ -1,35 +1,96 @@ from sage.misc.lazy_import import lazy_import -from .misc import (algdep, bernoulli, is_prime, is_prime_power, - is_pseudoprime, is_pseudoprime_power, - prime_powers, primes_first_n, eratosthenes, primes, - next_prime_power, next_probable_prime, next_prime, - previous_prime, previous_prime_power, random_prime, - divisors, sigma, gcd, GCD, xlcm, xgcd, xkcd, - inverse_mod, get_gcd, get_inverse_mod, power_mod, - rational_reconstruction, mqrr_rational_reconstruction, - trial_division, factor, prime_divisors, odd_part, prime_to_m_part, - is_square, is_squarefree, euler_phi, carmichael_lambda, crt, CRT, - CRT_list, CRT_basis, CRT_vectors, multinomial, multinomial_coefficients, - binomial, factorial, kronecker_symbol, kronecker, legendre_symbol, - primitive_root, nth_prime, quadratic_residues, moebius, - continuant, number_of_divisors, hilbert_symbol, hilbert_conductor, - hilbert_conductor_inverse, falling_factorial, rising_factorial, - integer_ceil, integer_floor, - two_squares, three_squares, four_squares, sum_of_k_squares, - subfactorial, is_power_of_two, differences, +from sage.arith.misc import ( + algdep, + bernoulli, + is_prime, + is_prime_power, + is_pseudoprime, + is_pseudoprime_power, + prime_powers, + primes_first_n, + eratosthenes, + primes, + next_prime_power, + next_probable_prime, + next_prime, + previous_prime, + previous_prime_power, + random_prime, + divisors, + sigma, + gcd, + GCD, + xlcm, + xgcd, + xkcd, + inverse_mod, + get_gcd, + get_inverse_mod, + power_mod, + rational_reconstruction, + mqrr_rational_reconstruction, + trial_division, + factor, + prime_divisors, + odd_part, + prime_to_m_part, + is_square, + is_squarefree, + euler_phi, + carmichael_lambda, + crt, + CRT, + CRT_list, + CRT_basis, + CRT_vectors, + multinomial, + multinomial_coefficients, + binomial, + factorial, + kronecker_symbol, + kronecker, + legendre_symbol, + primitive_root, + nth_prime, + quadratic_residues, + moebius, + continuant, + number_of_divisors, + hilbert_symbol, + hilbert_conductor, + hilbert_conductor_inverse, + falling_factorial, + rising_factorial, + integer_ceil, + integer_floor, + two_squares, + three_squares, + four_squares, + sum_of_k_squares, + subfactorial, + is_power_of_two, + differences, sort_complex_numbers_for_display, - fundamental_discriminant, squarefree_divisors, - radical, binomial_coefficients, jacobi_symbol, + fundamental_discriminant, + squarefree_divisors, + radical, + binomial_coefficients, + jacobi_symbol, dedekind_sum, - prime_factors, prime_range, valuation) + prime_factors, + prime_range, + valuation, +) -lazy_import('sage.arith.misc', ('Sigma', 'Moebius', 'Euler_Phi'), deprecation=30322) +lazy_import("sage.arith.misc", ("Sigma", "Moebius", "Euler_Phi"), deprecation=30322) + +from sage.arith.functions import lcm -from .functions import lcm LCM = lcm -from .srange import xsrange, srange, ellipsis_iter, ellipsis_range +from sage.arith.srange import xsrange, srange, ellipsis_iter, ellipsis_range + sxrange = xsrange σ = sigma diff --git a/src/sage/arith/power.pyx b/src/sage/arith/power.pyx index 65090f23c23..2b4cbd099d1 100644 --- a/src/sage/arith/power.pyx +++ b/src/sage/arith/power.pyx @@ -17,7 +17,7 @@ square-and-multiply algorithm. from cysignals.signals cimport sig_check -from .long cimport integer_check_long +from sage.arith.long cimport integer_check_long cpdef generic_power(a, n) noexcept: diff --git a/src/sage/cpython/all.py b/src/sage/cpython/all.py index d35cd6f2e8a..d48ee4c7d45 100644 --- a/src/sage/cpython/all.py +++ b/src/sage/cpython/all.py @@ -1,2 +1,2 @@ -from .debug import getattr_debug, type_debug -from .getattr import raw_getattr +from sage.cpython.debug import getattr_debug, type_debug +from sage.cpython.getattr import raw_getattr diff --git a/src/sage/cpython/debug.pyx b/src/sage/cpython/debug.pyx index cdaca3a4854..0cfc1fc2388 100644 --- a/src/sage/cpython/debug.pyx +++ b/src/sage/cpython/debug.pyx @@ -21,7 +21,7 @@ cdef extern from "Python.h": cdef extern from "sage/cpython/debugimpl.c": void _type_debug(PyTypeObject*) -from .getattr cimport AttributeErrorMessage +from sage.cpython.getattr cimport AttributeErrorMessage # Determine subtype_traverse, subtype_clear, subtype_dealloc functions diff --git a/src/sage/data_structures/all.py b/src/sage/data_structures/all.py index 43c5de52d5a..eac1b4b8931 100644 --- a/src/sage/data_structures/all.py +++ b/src/sage/data_structures/all.py @@ -1,2 +1,2 @@ -from .bitset import Bitset, FrozenBitset +from sage.data_structures.bitset import Bitset, FrozenBitset diff --git a/src/sage/data_structures/bitset.pxd b/src/sage/data_structures/bitset.pxd index d8122c05165..0d72f7eb6ed 100644 --- a/src/sage/data_structures/bitset.pxd +++ b/src/sage/data_structures/bitset.pxd @@ -7,7 +7,7 @@ # http://www.gnu.org/licenses/ #***************************************************************************** -from .bitset_base cimport bitset_t +from sage.data_structures.bitset_base cimport bitset_t # Python layer over bitset_t cdef class FrozenBitset: diff --git a/src/sage/data_structures/bitset.pyx b/src/sage/data_structures/bitset.pyx index 0e3f6e3d640..5c341c8a003 100644 --- a/src/sage/data_structures/bitset.pyx +++ b/src/sage/data_structures/bitset.pyx @@ -31,7 +31,7 @@ linear in ``capacity``. # http://www.gnu.org/licenses/ #***************************************************************************** -from .bitset_base cimport * +from sage.data_structures.bitset_base cimport * from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE diff --git a/src/sage/misc/all.py b/src/sage/misc/all.py index e5a6418043a..5876ef9484d 100644 --- a/src/sage/misc/all.py +++ b/src/sage/misc/all.py @@ -1,11 +1,11 @@ -from .lazy_attribute import lazy_attribute, lazy_class_attribute -from .lazy_import import lazy_import +from sage.misc.lazy_attribute import lazy_attribute, lazy_class_attribute +from sage.misc.lazy_import import lazy_import -from .all__sagemath_objects import * -from .all__sagemath_environment import * -from .all__sagemath_repl import * +from sage.misc.all__sagemath_objects import * +from sage.misc.all__sagemath_environment import * +from sage.misc.all__sagemath_repl import * -from .misc import (BackslashOperator, +from sage.misc.misc import (BackslashOperator, exists, forall, is_iterator, random_sublist, pad_zeros, @@ -15,27 +15,27 @@ lazy_import('sage.misc.misc', 'union', deprecation=32096) -from .banner import version +from sage.misc.banner import version -from .dev_tools import import_statements +from sage.misc.dev_tools import import_statements -from .html import html, pretty_print_default +from sage.misc.html import html, pretty_print_default -from .table import table +from sage.misc.table import table -from .sage_timeit_class import timeit +from sage.misc.sage_timeit_class import timeit -from .edit_module import edit +from sage.misc.edit_module import edit -from .map_threaded import map_threaded +from sage.misc.map_threaded import map_threaded -from .session import load_session, save_session, show_identifiers +from sage.misc.session import load_session, save_session, show_identifiers -from .remote_file import get_remote_file +from sage.misc.remote_file import get_remote_file -from .mrange import xmrange, mrange, xmrange_iter, mrange_iter, cartesian_product_iterator +from sage.misc.mrange import xmrange, mrange, xmrange_iter, mrange_iter, cartesian_product_iterator -from .fpickle import pickle_function, unpickle_function +from sage.misc.fpickle import pickle_function, unpickle_function lazy_import('sage.misc.pager', 'pager') @@ -45,21 +45,21 @@ 'constructions', 'help']) lazy_import('pydoc', 'help', 'python_help') -from .classgraph import class_graph +from sage.misc.classgraph import class_graph -from .reset import reset, restore +from sage.misc.reset import reset, restore -from .mathml import mathml +from sage.misc.mathml import mathml -from .defaults import (set_default_variable_name, +from sage.misc.defaults import (set_default_variable_name, series_precision, set_series_precision) lazy_import("sage.misc.cython", "cython_lambda") lazy_import("sage.misc.cython", "cython_compile", "cython") -from .func_persist import func_persist +from sage.misc.func_persist import func_persist -from .functional import (additive_order, +from sage.misc.functional import (additive_order, base_ring, base_field, basis, @@ -118,15 +118,15 @@ transpose) -from .latex import LatexExpr, latex, view +from sage.misc.latex import LatexExpr, latex, view -from .randstate import seed, set_random_seed, initial_seed, current_randstate +from sage.misc.randstate import seed, set_random_seed, initial_seed, current_randstate -from .prandom import * +from sage.misc.prandom import * -from .timing import walltime, cputime +from sage.misc.timing import walltime, cputime -from .explain_pickle import explain_pickle, unpickle_newobj, unpickle_global, unpickle_build, unpickle_instantiate, unpickle_persistent, unpickle_extension, unpickle_appends +from sage.misc.explain_pickle import explain_pickle, unpickle_newobj, unpickle_global, unpickle_build, unpickle_instantiate, unpickle_persistent, unpickle_extension, unpickle_appends lazy_import('sage.misc.inline_fortran', 'fortran') diff --git a/src/sage/misc/all__sagemath_environment.py b/src/sage/misc/all__sagemath_environment.py index f25faa1289d..9ebcc85870b 100644 --- a/src/sage/misc/all__sagemath_environment.py +++ b/src/sage/misc/all__sagemath_environment.py @@ -1 +1 @@ -from .temporary_file import tmp_dir, tmp_filename +from sage.misc.temporary_file import tmp_dir, tmp_filename diff --git a/src/sage/misc/all__sagemath_objects.py b/src/sage/misc/all__sagemath_objects.py index 43a9c1c06d5..30a76f38fab 100644 --- a/src/sage/misc/all__sagemath_objects.py +++ b/src/sage/misc/all__sagemath_objects.py @@ -2,35 +2,35 @@ import sage.structure.all # to break a cyclic import -from .lazy_attribute import lazy_attribute, lazy_class_attribute -from .lazy_import import lazy_import +from sage.misc.lazy_attribute import lazy_attribute, lazy_class_attribute +from sage.misc.lazy_import import lazy_import -from .verbose import (set_verbose, set_verbose_files, +from sage.misc.verbose import (set_verbose, set_verbose_files, get_verbose_files, unset_verbose_files, get_verbose) lazy_import('sage.misc.verbose', 'verbose', deprecation=17815) -from .call import attrcall +from sage.misc.call import attrcall -from .misc_c import prod, running_total, balanced_sum +from sage.misc.misc_c import prod, running_total, balanced_sum mul = prod add = sum -from .repr import repr_lincomb +from sage.misc.repr import repr_lincomb -from .flatten import flatten +from sage.misc.flatten import flatten -from .persist import save, load, dumps, loads, db, db_save +from sage.misc.persist import save, load, dumps, loads, db, db_save -from .constant_function import ConstantFunction +from sage.misc.constant_function import ConstantFunction -from .sage_unittest import TestSuite +from sage.misc.sage_unittest import TestSuite -from .decorators import specialize, sage_wraps, infix_operator +from sage.misc.decorators import specialize, sage_wraps, infix_operator -from .unknown import Unknown, UnknownError +from sage.misc.unknown import Unknown, UnknownError -from .cachefunc import CachedFunction, cached_function, cached_method, cached_in_parent_method, disk_cached_function +from sage.misc.cachefunc import CachedFunction, cached_function, cached_method, cached_in_parent_method, disk_cached_function -from .abstract_method import abstract_method +from sage.misc.abstract_method import abstract_method -from .timing import walltime, cputime +from sage.misc.timing import walltime, cputime diff --git a/src/sage/misc/all__sagemath_repl.py b/src/sage/misc/all__sagemath_repl.py index f5891ff1242..c7acba4ab07 100644 --- a/src/sage/misc/all__sagemath_repl.py +++ b/src/sage/misc/all__sagemath_repl.py @@ -1,3 +1,3 @@ -from .sage_eval import sage_eval, sageobj +from sage.misc.sage_eval import sage_eval, sageobj -from .sage_input import sage_input +from sage.misc.sage_input import sage_input diff --git a/src/sage/misc/benchmark.py b/src/sage/misc/benchmark.py index 2a6ee53a0c1..0309571905d 100644 --- a/src/sage/misc/benchmark.py +++ b/src/sage/misc/benchmark.py @@ -1,6 +1,6 @@ "Benchmarks" -from .misc import cputime +from sage.misc.misc import cputime from sage.all import * diff --git a/src/sage/misc/copying.py b/src/sage/misc/copying.py index bcd6c9c3646..cec1a5189cd 100644 --- a/src/sage/misc/copying.py +++ b/src/sage/misc/copying.py @@ -1,7 +1,7 @@ "License" import os -from . import pager +from sage.misc import pager from sage.env import SAGE_ROOT diff --git a/src/sage/misc/cython.py b/src/sage/misc/cython.py index c0c803bf943..268593e557d 100644 --- a/src/sage/misc/cython.py +++ b/src/sage/misc/cython.py @@ -27,7 +27,7 @@ from sage.env import (SAGE_LOCAL, cython_aliases, sage_include_directories) -from .temporary_file import spyx_tmp, tmp_filename +from sage.misc.temporary_file import spyx_tmp, tmp_filename from sage.repl.user_globals import get_globals from sage.misc.sage_ostools import restore_cwd, redirection from sage.cpython.string import str_to_bytes diff --git a/src/sage/misc/func_persist.py b/src/sage/misc/func_persist.py index cf020479440..65b6d536d79 100644 --- a/src/sage/misc/func_persist.py +++ b/src/sage/misc/func_persist.py @@ -43,7 +43,7 @@ def bern(n): import inspect import os -from . import persist +from sage.misc import persist class func_persist: r""" diff --git a/src/sage/misc/lazy_import_cache.py b/src/sage/misc/lazy_import_cache.py index e34c0ca6942..191a2058e2b 100644 --- a/src/sage/misc/lazy_import_cache.py +++ b/src/sage/misc/lazy_import_cache.py @@ -6,7 +6,7 @@ import os import hashlib -from ..env import SAGE_LIB, DOT_SAGE +from sage.env import SAGE_LIB, DOT_SAGE def get_cache_file(): diff --git a/src/sage/misc/misc.py b/src/sage/misc/misc.py index 936f279a690..4f60a11b780 100644 --- a/src/sage/misc/misc.py +++ b/src/sage/misc/misc.py @@ -45,7 +45,7 @@ import sys import warnings -from .lazy_string import lazy_string +from sage.misc.lazy_string import lazy_string from sage.env import DOT_SAGE, HOSTNAME from sage.misc.lazy_import import lazy_import diff --git a/src/sage/misc/sagedoc.py b/src/sage/misc/sagedoc.py index fb11088dac9..2632d0c4359 100644 --- a/src/sage/misc/sagedoc.py +++ b/src/sage/misc/sagedoc.py @@ -45,8 +45,8 @@ import sys import pydoc from sage.misc.temporary_file import tmp_dir -from .viewer import browser -from . import sageinspect +from sage.misc.viewer import browser +from sage.misc import sageinspect import sage.version from sage.env import SAGE_DOC, SAGE_SRC