Skip to content

Commit b56aaae

Browse files
alexchandler100Matthias Koeppe
authored andcommitted
sage -fiximports src/sage/{misc,monoids,sets}
1 parent 9116c55 commit b56aaae

File tree

10 files changed

+17
-14
lines changed

10 files changed

+17
-14
lines changed

src/sage/misc/cachefunc.pyx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ approach is still needed for cpdef methods::
6969
sage: cython_code = ['cpdef test_meth(self,x):',
7070
....: ' "some doc for a wrapped cython method"',
7171
....: ' return -x',
72-
....: 'from sage.all import cached_method',
72+
....: 'from sage.misc.cachefunc import cached_method',
7373
....: 'from sage.structure.parent cimport Parent',
7474
....: 'cdef class MyClass(Parent):',
7575
....: ' @cached_method',
@@ -107,7 +107,10 @@ By :trac:`11115`, even if a parent does not allow attribute
107107
assignment, it can inherit a cached method from the parent class of a
108108
category (previously, the cache would have been broken)::
109109
110-
sage: cython_code = ["from sage.all import cached_method, cached_in_parent_method, Category, Objects",
110+
sage: cython_code = ["from sage.misc.cachefunc import cached_method",
111+
....: "from sage.misc.cachefunc import cached_in_parent_method",
112+
....: "from sage.categories.category import Category",
113+
....: "from sage.categories.objects import Objects",
111114
....: "class MyCategory(Category):",
112115
....: " @cached_method",
113116
....: " def super_categories(self):",

src/sage/misc/fast_methods.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ class Singleton(WithEqualityById, metaclass=ClasscallMetaclass):
311311
EXAMPLES::
312312
313313
sage: from sage.misc.fast_methods import Singleton
314-
sage: class C(Singleton, Parent):
314+
sage: class C(Singleton, Parent):
315315
....: def __init__(self):
316316
....: print("creating singleton")
317317
....: Parent.__init__(self, base=ZZ, category=Rings())
@@ -321,7 +321,7 @@ class Singleton(WithEqualityById, metaclass=ClasscallMetaclass):
321321
sage: __main__.C = C # ... in doctests
322322
sage: loads(dumps(c)) is copy(c) is C() # indirect doctest
323323
True
324-
"""
324+
"""
325325
return self
326326

327327
def __reduce__(self):
@@ -332,7 +332,7 @@ class Singleton(WithEqualityById, metaclass=ClasscallMetaclass):
332332
EXAMPLES::
333333
334334
sage: from sage.misc.fast_methods import Singleton
335-
sage: class C(Singleton, Parent):
335+
sage: class C(Singleton, Parent):
336336
....: def __init__(self):
337337
....: print("creating singleton")
338338
....: Parent.__init__(self, base=ZZ, category=Rings())
@@ -349,5 +349,5 @@ class Singleton(WithEqualityById, metaclass=ClasscallMetaclass):
349349
instance.If the class is replaced by a sub-sub-class after creation
350350
of the instance, pickling fails. See the doctest
351351
in :class:`Singleton`.
352-
"""
352+
"""
353353
return self.__class__, ()

src/sage/misc/functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,7 @@ def squarefree_part(x):
18221822
return x.squarefree_part()
18231823
except AttributeError:
18241824
pass
1825-
from sage.arith.all import factor
1825+
from sage.arith.misc import factor
18261826
from sage.structure.all import parent
18271827
F = factor(x)
18281828
n = parent(x)(1)

src/sage/misc/latex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def float_function(x):
409409
sage: latex(float(2e-13))
410410
2 \times 10^{-13}
411411
"""
412-
from sage.all import RDF
412+
from sage.rings.real_double import RDF
413413
return latex(RDF(x))
414414

415415

src/sage/misc/persist.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def _base_dumps(obj, compress=True):
298298

299299
global already_pickled
300300
gherkin = SagePickler.dumps(obj)
301-
already_pickled = { }
301+
already_pickled = { }
302302

303303
if compress:
304304
return comp.compress(gherkin)

src/sage/monoids/string_monoid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ def __init__(self):
521521
sage: S([ i for i in range(26) ])
522522
ABCDEFGHIJKLMNOPQRSTUVWXYZ
523523
"""
524-
from sage.rings.all import RealField
524+
from sage.rings.real_mpfr import RealField
525525
RR = RealField()
526526
# The characteristic frequency probability distribution of
527527
# Robert Edward Lewand.

src/sage/monoids/string_monoid_element.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
# import operator
2424
from sage.rings.integer import Integer
25-
from sage.rings.all import RealField
25+
from sage.rings.real_mpfr import RealField
2626
from .free_monoid_element import FreeMonoidElement
2727
from sage.structure.richcmp import richcmp
2828

src/sage/monoids/string_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# http://www.gnu.org/licenses/
99
#*****************************************************************************
1010

11-
from sage.rings.all import RealField
11+
from sage.rings.real_mpfr import RealField
1212
from .string_monoid_element import StringMonoidElement
1313

1414
def strip_encoding(S):

src/sage/sets/disjoint_set.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ cdef class DisjointSet_class(SageObject):
237237
sage: e == d
238238
True
239239
"""
240-
from sage.sets.all import Set
240+
from sage.sets.set import Set
241241
s = Set(map(Set, self.root_to_elements_dict().values()))
242242
try:
243243
t = Set(map(Set, other.root_to_elements_dict().values()))

src/sage/sets/primes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from sage.rings.integer_ring import ZZ
1818
from .set import Set_generic
1919
from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets
20-
from sage.arith.all import nth_prime
20+
from sage.arith.misc import nth_prime
2121
from sage.structure.unique_representation import UniqueRepresentation
2222

2323

0 commit comments

Comments
 (0)