On Mon, Aug 20, 2012 at 06:12:49AM +0200, Vincent Delecroix wrote:
> if my_set in FiniteSets():
>    # some stuff for finite sets
>    ...
> elif my_set in InfiniteSets():
>    # some stuff for infinite sets
>    ...
> elif my_set in Sets():
>    # some stuff for finite or infinite sets
>    ...
> else:
>     raise ValueError("this is not a set!")
> 
> I think that the above code is enough clear to get rid of a is_finite method.

See also the recent discussion we had with Martin about the difference
between X in FiniteSets() and X.is_finite().

(calling is_finite may possibly trigger an expensive/undecidable
calculation to decide whether the set is finite or not).

Cheers,
                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to