>
>
> $ git diff src/sage/sets/disjoint_union_enumerated_sets.py 
> diff --git a/src/sage/sets/disjoint_union_enumerated_sets.py 
> b/src/sage/sets/disjoint_union_enumerated_sets.py 
> index c6d35ea8bd..f5fdba7119 100644 
> --- a/src/sage/sets/disjoint_union_enumerated_sets.py 
> +++ b/src/sage/sets/disjoint_union_enumerated_sets.py 
> @@ -302,7 +302,7 @@ class 
> DisjointUnionEnumeratedSets(UniqueRepresentation, Parent): 
>               # try to guess if the result is infinite or not. 
>               if self._family in InfiniteEnumeratedSets(): 
>                   category = InfiniteEnumeratedSets() 
> -            elif self._family.last().cardinality() == Infinity: 
> +            elif any(x.cardinality() == Infinity for x in self._family): 
>                   category = InfiniteEnumeratedSets() 
>               else: 
>                   category = FiniteEnumeratedSets() 
>
> I can't think of a reasonable way of checking against the infinite union 
> of 
> empty sets. 
>
> That is because it is an undecidable problem. I think it is a safe bet 
that if someone was passing an infinite union, then assume that an infinite 
number of sets have an element. This can be explicitly stated as a .. 
WARNING:: or .. NOTE:: in the documentation. However, you should be careful 
about iterating over anything you do not explicitly know is finite as it 
could run into an infinite loop, and we generally want to avoid that.

Best,
Travis

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/610e33d3-ccbc-4040-8803-ee9ddcf1b936o%40googlegroups.com.

Reply via email to