#20575: Iterator over random vertices/edges
-------------------------+-------------------------------------------------
Reporter: | Owner:
dcoudert | Status: needs_review
Type: | Milestone: sage-7.3
enhancement | Resolution:
Priority: minor | Merged in:
Component: graph | Reviewers:
theory | Work issues:
Keywords: | Commit:
Authors: David | 0b10566432a8dff2ac53613dd98015d5338281b6
Coudert | Stopgaps:
Report Upstream: N/A |
Branch: |
u/dcoudert/20575 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by vdelecroix):
First of all you would better use `choice(my_list)` rather than
`my_list[randint(0,length-1)]`.
And in the case of an empty graph I would either:
- raise an `EmptySetError` (from `sage.categories.sets_cat`)
- return an empty iterator, for example `return iter([])`
But anyway, you would better document the behavior of this special case.
--
Ticket URL: <http://trac.sagemath.org/ticket/20575#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.