An example: sage: g = Graph({0:[1,2]}) sage: list(g.breadth_first_search(0, distance='junk')) [0, 1, 2]
This can be corrected: try: n = Integer(...) ... if n<0: raise...But it seems stupid to mechanically copy this code. So should we add something like _check_integer_all(), _check_integer_nonnegative() and _check_integer_positive() to Sage? This way hopefully we would get more checking for errors and have unified exception strings?
-- Jori Mäntysalo