I think that the default of returning a sublattice makes most sense by far.

In case the speed difference is very significant (why would this be the
case?), one could add an optional argument to the function to just
return a list. Could be named "as_list = False", I guess.

Johan

Jori Mäntysalo writes:

> I am making functions to compute, for example, maximal sublattices or
> Frattini sublattice of a lattice. It is somewhat faster to return only
> list of elements instead of lattice. What you think, should the function
> return
>
> 1) a sublattice, ready to use as a lattice for further computations;
> user might say .list() when only list of elements is needed, or use
> directly function from hasse_diagram.py if more speed is needed,
>
> 2) a list; user can say orig_lattice.sublattice(result) when really
> the lattice is needed, or
>
> 3) both?
>
> If 3, what should be the name of the parameter. At least 
> "element_constructor" is used somewhere, but I think there is also some 
> other names used.

-- 

-- 
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 post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to