Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
fe8e0085
Commit
fe8e0085
authored
Jul 16, 2013
by
Tiago Peixoto
Browse files
Fix behaviour of Graph.add_vertex(n) for n == 0
parent
8a44eee1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/__init__.py
View file @
fe8e0085
...
...
@@ -1245,10 +1245,13 @@ class Graph(object):
return
libcore
.
get_edges
(
weakref
.
ref
(
self
))
def
add_vertex
(
self
,
n
=
1
):
"""Add a vertex to the graph, and return it. If ``n
>
1``, ``n``
"""Add a vertex to the graph, and return it. If ``n
!=
1``, ``n``
vertices are inserted and an iterator over the new vertices is returned.
This operation is :math:`O(n)`.
"""
if
n
==
0
:
return
(
None
for
i
in
range
(
0
,
0
))
self
.
__check_perms
(
"add_vertex"
)
v
=
libcore
.
add_vertex
(
weakref
.
ref
(
self
),
n
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment