# HG changeset patch
# User Florent Hivert <Florent.Hivert@univ-rouen.fr>
# Date 1307030246 -7200
# Node ID 4d758d4183a839a68243dd26a0d8278d3c51af38
# Parent  d207d1e9001fb3f702a8fd0cabc97efb02da1368
#11412 fix partitions from core and quotients: review patch

diff --git a/sage/combinat/partition.py b/sage/combinat/partition.py
--- a/sage/combinat/partition.py
+++ b/sage/combinat/partition.py
@@ -323,13 +323,25 @@ def from_core_and_quotient(core, quotien
 
         sage: Partition(core=[2,1], quotient=[[2,1],[3],[1,1,1]])
         [11, 5, 5, 3, 2, 2, 2]
-        sage: test = lambda x, k: x == Partition(core=x.core(k),quotient=x.quotient(k))
-        sage: all(test(mu,k) for k in range(1,5) for n in range(10) for mu in Partitions(n))
+
+    TESTS: We check that #11412 is actually fixed::
+
+        sage: test = lambda x, k: x == Partition(core=x.core(k),
+        ...                                      quotient=x.quotient(k))
+        sage: all(test(mu,k) for k in range(1,5)
+        ...       for n in range(10) for mu in Partitions(n))
         True
-        sage: test2 = lambda core, mus: \ 
-        Partition(core=core, quotient=mus).core(len(mus)) == core and \
-        Partition(core=core, quotient=mus).quotient(len(mus)) == mus
-        sage: all(test2(core,tuple(mus)) for k in range(1,10) for n_core in range(10-k) for core in Partitions(n_core) if core.core(k) == core for n_mus in range(10-k) for mus in PartitionTuples(n_mus,k))
+        sage: test2 = lambda core, mus: (
+        ...       Partition(core=core, quotient=mus).core(len(mus)) == core
+        ...       and
+        ...       Partition(core=core, quotient=mus).quotient(len(mus)) == mus)
+        sage: all(test2(core,tuple(mus))
+        ...       for k in range(1,10)
+        ...       for n_core in range(10-k)
+        ...       for core in Partitions(n_core)
+        ...       if core.core(k) == core
+        ...       for n_mus in range(10-k)
+        ...       for mus in PartitionTuples(n_mus,k))
         True
     """
     length = len(quotient)
@@ -346,7 +358,7 @@ def from_core_and_quotient(core, quotien
         new_w += [ w[i][j] for j in range(lq,lw)]
     new_w.sort(reverse=True)
     return Partition([new_w[i]+i for i in range(len(new_w))])
-   
+
 class Partition_class(CombinatorialObject):
     def ferrers_diagram(self):
         """
