Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
e8999df8
Commit
e8999df8
authored
Aug 28, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add clear() method to cypclass dict
parent
b926c619
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
Cython/Includes/libcythonplus/dict.pxd
Cython/Includes/libcythonplus/dict.pxd
+11
-0
No files found.
Cython/Includes/libcythonplus/dict.pxd
View file @
e8999df8
...
@@ -277,6 +277,17 @@ cdef cypclass cypdict[K, V]:
...
@@ -277,6 +277,17 @@ cdef cypclass cypdict[K, V]:
with
gil
:
with
gil
:
raise
KeyError
(
"Deleting nonexistent item"
)
raise
KeyError
(
"Deleting nonexistent item"
)
void
clear
(
self
)
except
~
:
if
self
.
_active_iterators
==
0
:
for
item
in
self
.
_items
:
Cy_DECREF
(
item
.
first
)
Cy_DECREF
(
item
.
second
)
self
.
_items
.
clear
()
self
.
_indices
.
clear
()
else
:
with
gil
:
raise
RuntimeError
(
"Modifying a dictionary with active iterators"
)
key_iterator_t
[
cypdict
[
K
,
V
],
vector
[
item_type
].
iterator
,
key_type
]
begin
(
self
):
key_iterator_t
[
cypdict
[
K
,
V
],
vector
[
item_type
].
iterator
,
key_type
]
begin
(
self
):
return
key_iterator_t
[
cypdict
[
K
,
V
],
vector
[
item_type
].
iterator
,
key_type
](
self
.
_items
.
begin
(),
self
)
return
key_iterator_t
[
cypdict
[
K
,
V
],
vector
[
item_type
].
iterator
,
key_type
](
self
.
_items
.
begin
(),
self
)
...
...
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