-
-
Notifications
You must be signed in to change notification settings - Fork 656
fix some wrong syntax #40747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
fix some wrong syntax #40747
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -680,7 +680,7 @@ def representation_matrix_for_simple_transposition(self, i): | |
M = matrix(self._ring, digraph.num_verts()) | ||
for g in digraph.connected_components_subgraphs(): | ||
if g.num_verts() == 1: | ||
[v] = g.vertices(sort=True) | ||
v, = g.vertices(sort=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same question here. may be you can use |
||
w = self._word_dict[v] | ||
trivial = None | ||
for j, a in enumerate(w): | ||
|
@@ -693,7 +693,7 @@ def representation_matrix_for_simple_transposition(self, i): | |
j = index_lookup[v] | ||
M[j, j] = 1 if trivial is True else -1 | ||
else: | ||
[(u, v, (j, beta))] = g.edges(sort=True) | ||
(u, v, (j, beta)), = g.edges(sort=True) | ||
iu = index_lookup[u] | ||
iv = index_lookup[v] | ||
M[iu, iu], M[iu, iv], M[iv, iu], M[iv, iv] = \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1585,7 +1585,7 @@ def edge_connectivity(G, | |
if implementation == "boost": | ||
from sage.graphs.base.boost_graph import edge_connectivity | ||
|
||
[obj, edges] = edge_connectivity(g) | ||
obj, edges = edge_connectivity(g) | ||
|
||
if value_only: | ||
return obj | ||
|
@@ -2460,7 +2460,7 @@ def bridges(G, labels=True): | |
if len(b) == 2 and not tuple(b) in ME: | ||
if labels: | ||
if multiple_edges: | ||
[label] = G.edge_label(b[0], b[1]) | ||
label, = G.edge_label(b[0], b[1]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here again |
||
else: | ||
label = G.edge_label(b[0], b[1]) | ||
yield (b[0], b[1], label) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1548,7 +1548,7 @@ cdef class TreelengthConnected: | |
cdef frozenset reduced_cut | ||
|
||
if len(cc) == 1: | ||
[v] = cc | ||
v, = cc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
# We identify the neighbors of v in cut | ||
reduced_cut = cut.intersection(g.neighbor_iterator(v)) | ||
# We can form a new bag with its closed neighborhood, and this | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure it's the correct syntax ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it works to unpack a list or tuple with one element
sage: moulinsart, = [421]