diff --git a/src/sage/sets/disjoint_set.pyx b/src/sage/sets/disjoint_set.pyx index 7a832104295..ddd9a95a310 100644 --- a/src/sage/sets/disjoint_set.pyx +++ b/src/sage/sets/disjoint_set.pyx @@ -62,7 +62,10 @@ from sage.rings.integer cimport Integer from sage.structure.sage_object cimport SageObject from cpython.object cimport PyObject_RichCompare from sage.groups.perm_gps.partn_ref.data_structures cimport * -from sage.combinat.set_partition import SetPartition +from sage.misc.lazy_import import LazyImport + +SetPartition = LazyImport('sage.combinat.set_partition', 'SetPartition') + cpdef DisjointSet(arg): r""" diff --git a/src/sage/sets/image_set.py b/src/sage/sets/image_set.py index 8691edbcd01..a518dc58f93 100644 --- a/src/sage/sets/image_set.py +++ b/src/sage/sets/image_set.py @@ -25,7 +25,6 @@ from sage.misc.cachefunc import cached_method from sage.rings.infinity import Infinity from sage.rings.integer import Integer -from sage.modules.free_module import FreeModule from sage.structure.element import Expression from sage.structure.parent import Parent @@ -91,6 +90,7 @@ def __init__(self, map, domain_subset, *, category=None, is_injective=None, inve if isinstance(map, Expression) and map.is_callable(): domain = map.parent().base() if len(map.arguments()) != 1: + from sage.modules.free_module import FreeModule domain = FreeModule(domain, len(map.arguments())) function = map