@@ -250,8 +250,9 @@ def _hash_(self):
250
250
251
251
def base_set (self ):
252
252
"""
253
- Return the base set of ``self``, which is the union of all parts
254
- of ``self``.
253
+ Return the base set of ``self``.
254
+
255
+ This is the union of all parts of ``self``.
255
256
256
257
EXAMPLES::
257
258
@@ -276,8 +277,9 @@ def base_set(self):
276
277
277
278
def base_set_cardinality (self ):
278
279
"""
279
- Return the cardinality of the base set of ``self``, which is the sum
280
- of the sizes of the parts of ``self``.
280
+ Return the cardinality of the base set of ``self``.
281
+
282
+ This is the sum of the sizes of the parts of ``self``.
281
283
282
284
This is also known as the *size* (sometimes the *weight*) of
283
285
an ordered set partition.
@@ -288,8 +290,17 @@ def base_set_cardinality(self):
288
290
4
289
291
sage: OrderedSetPartition([[1,2,3,4]]).base_set_cardinality()
290
292
4
293
+
294
+ TESTS::
295
+
296
+ sage: S = OrderedSetPartitions()
297
+ sage: S([[1,4],[3],[2]]).base_set_cardinality()
298
+ 4
291
299
"""
292
- return len (parent (self )._set )
300
+ try :
301
+ return len (parent (self )._set )
302
+ except AttributeError : # in OrderedSetPartitions_all
303
+ return sum (len (part ) for part in self )
293
304
294
305
size = base_set_cardinality
295
306
0 commit comments