Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stdlib
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cython-plus
stdlib
Commits
731f1925
Commit
731f1925
authored
Oct 07, 2022
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix list membership test
parent
e1949632
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
_list.pxd
_list.pxd
+8
-0
list.pxd
list.pxd
+1
-1
No files found.
_list.pxd
View file @
731f1925
...
...
@@ -19,3 +19,11 @@ cdef extern from * nogil:
list_iterator_t
operator
++
()
bint
operator
!=
(
base_iterator_t
)
# Needed to implement "value in list" test for template list
cdef
extern
from
"<functional>"
namespace
"std"
nogil
:
cdef
cppclass
equal_to
[
T
=*
]:
# https://github.com/cython/cython/issues/3193
equal_to
()
except
+
bint
operator
()(
const
T
&
lhs
,
const
T
&
rhs
)
except
+
list.pxd
View file @
731f1925
...
...
@@ -118,7 +118,7 @@ cdef cypclass List[V]:
bint
__contains__
(
const
self
,
const
value_type
value
):
for
v
in
self
.
_elements
:
if
value
is
v
:
if
equal_to
[
value_type
]()(
value
,
v
)
:
return
1
return
0
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