#10932: Fix typo in the multiple edges detection code of DiGraph
---------------------------------+------------------------------------------
Reporter: nthiery | Owner: jason, ncohen, rlm
Type: defect | Status: needs_review
Priority: major | Milestone:
Component: graph theory | Keywords:
Author: Nicolas M. ThiƩry | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
---------------------------------+------------------------------------------
Old description:
> {{{
> sage: DiGraph([(1, 2, 0), (1,2,1)])
> Traceback (most recent call last):
> ...
> File "/opt/sage-4.6.2/local/lib/python2.6/site-
> packages/sage/graphs/digraph.py", line 417, in __init__
> (u in data[v])):
> KeyError: 2
>
> sage: sage: DiGraph([(1, 2, 0)])
> ------------------------------------------------------------
> Traceback (most recent call last):
> ...
> File "/opt/sage-4.6.2/local/lib/python2.6/site-
> packages/sage/graphs/digraph.py", line 417, in __init__
> (u in data[v])):
> KeyError: 2
>
> }}}
>
> The test should have been v in data[u]. I'll attach soon a patch doing
> this:
>
> {{{
> sage: DiGraph([(1, 2, 0), (1,2,1)])
> Multi-digraph on 2 vertices
> sage: DiGraph([(1, 2, 0)])
> Digraph on 2 vertices
> }}}
New description:
{{{
sage: DiGraph([(1, 2, 0), (1,2,1)])
Traceback (most recent call last):
...
File "/opt/sage-4.6.2/local/lib/python2.6/site-
packages/sage/graphs/digraph.py", line 417, in __init__
(u in data[v])):
KeyError: 2
sage: DiGraph([(1, 2, 0)])
------------------------------------------------------------
Traceback (most recent call last):
...
File "/opt/sage-4.6.2/local/lib/python2.6/site-
packages/sage/graphs/digraph.py", line 417, in __init__
(u in data[v])):
KeyError: 2
}}}
The test should have been v in data[u]. I'll attach soon a patch doing
this:
{{{
sage: DiGraph([(1, 2, 0), (1,2,1)])
Multi-digraph on 2 vertices
sage: DiGraph([(1, 2, 0)])
Digraph on 2 vertices
}}}
--
Comment(by nthiery):
Btw: pyflakes complains about ``choice`` not being defined on l. 602 of
this file. But I leave that to someone else to investigate this further.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10932#comment:2>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.