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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
6c30dd84
Commit
6c30dd84
authored
Aug 24, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix in-test when RHS needs coercion from non-Python type
parent
d887dac9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-1
tests/run/inop.pyx
tests/run/inop.pyx
+27
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
6c30dd84
...
...
@@ -8741,7 +8741,9 @@ class CmpNode(object):
self
.
special_bool_cmp_utility_code
=
UtilityCode
.
load_cached
(
"PyDictContains"
,
"ObjectHandling.c"
)
self
.
special_bool_cmp_function
=
"__Pyx_PyDict_Contains"
return
True
elif
self
.
operand2
.
type
.
is_pyobject
:
else
:
if
not
self
.
operand2
.
type
.
is_pyobject
:
self
.
operand2
=
self
.
operand2
.
coerce_to_pyobject
(
env
)
self
.
special_bool_cmp_utility_code
=
UtilityCode
.
load_cached
(
"PySequenceContains"
,
"ObjectHandling.c"
)
self
.
special_bool_cmp_function
=
"__Pyx_PySequence_Contains"
return
True
...
...
tests/run/inop.pyx
View file @
6c30dd84
...
...
@@ -349,3 +349,30 @@ def constant_empty_sequence(a):
False
"""
return
a
in
()
def
test_error_non_iterable
(
x
):
"""
>>> test_error_non_iterable(1) # doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: ...iterable...
"""
return
x
in
42
def
test_error_non_iterable_cascaded
(
x
):
"""
>>> test_error_non_iterable_cascaded(1) # doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: ...iterable...
"""
return
1
==
x
in
42
def
test_inop_cascaded
(
x
):
"""
>>> test_inop_cascaded(1)
False
>>> test_inop_cascaded(2)
True
>>> test_inop_cascaded(3)
False
"""
return
1
!=
x
in
[
2
]
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