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
Gwenaël Samain
cython
Commits
4f2b95e1
Commit
4f2b95e1
authored
Dec 20, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Refactor some code repetition into a loop."
This reverts commit
e1ae63dd
.
parent
e1ae63dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+18
-13
No files found.
Cython/Compiler/ExprNodes.py
View file @
4f2b95e1
...
@@ -12192,22 +12192,27 @@ class CmpNode(object):
...
@@ -12192,22 +12192,27 @@ class CmpNode(object):
self
.
special_bool_cmp_function
=
"__Pyx_PyString_Equals"
self
.
special_bool_cmp_function
=
"__Pyx_PyString_Equals"
return
True
return
True
elif
self
.
operator
in
(
'in'
,
'not_in'
):
elif
self
.
operator
in
(
'in'
,
'not_in'
):
for
type_name
,
special_type
in
[
if
self
.
operand2
.
type
is
Builtin
.
dict_type
:
(
'Dict'
,
Builtin
.
dict_type
),
self
.
operand2
=
self
.
operand2
.
as_none_safe_node
(
"'NoneType' object is not iterable"
)
(
'Set'
,
Builtin
.
set_type
),
self
.
special_bool_cmp_utility_code
=
UtilityCode
.
load_cached
(
"PyDictContains"
,
"ObjectHandling.c"
)
(
'Unicode'
,
Builtin
.
unicode_type
)]:
self
.
special_bool_cmp_function
=
"__Pyx_PyDict_ContainsTF"
if
self
.
operand2
.
type
is
special_type
:
return
True
self
.
operand2
=
self
.
operand2
.
as_none_safe_node
(
"'NoneType' object is not iterable"
)
elif
self
.
operand2
.
type
is
Builtin
.
set_type
:
break
self
.
operand2
=
self
.
operand2
.
as_none_safe_node
(
"'NoneType' object is not iterable"
)
self
.
special_bool_cmp_utility_code
=
UtilityCode
.
load_cached
(
"PySetContains"
,
"ObjectHandling.c"
)
self
.
special_bool_cmp_function
=
"__Pyx_PySet_ContainsTF"
return
True
elif
self
.
operand2
.
type
is
Builtin
.
unicode_type
:
self
.
operand2
=
self
.
operand2
.
as_none_safe_node
(
"'NoneType' object is not iterable"
)
self
.
special_bool_cmp_utility_code
=
UtilityCode
.
load_cached
(
"PyUnicodeContains"
,
"StringTools.c"
)
self
.
special_bool_cmp_function
=
"__Pyx_PyUnicode_ContainsTF"
return
True
else
:
else
:
if
not
self
.
operand2
.
type
.
is_pyobject
:
if
not
self
.
operand2
.
type
.
is_pyobject
:
self
.
operand2
=
self
.
operand2
.
coerce_to_pyobject
(
env
)
self
.
operand2
=
self
.
operand2
.
coerce_to_pyobject
(
env
)
type_name
=
'Sequence'
self
.
special_bool_cmp_utility_code
=
UtilityCode
.
load_cached
(
"PySequenceContains"
,
"ObjectHandling.c"
)
# map to utility functions PySequenceContains, PySetContains, PyDictContains etc.
self
.
special_bool_cmp_function
=
"__Pyx_PySequence_ContainsTF"
self
.
special_bool_cmp_utility_code
=
UtilityCode
.
load_cached
(
return
True
"Py%sContains"
%
type_name
,
"ObjectHandling.c"
)
self
.
special_bool_cmp_function
=
"__Pyx_Py%s_ContainsTF"
%
type_name
return
True
return
False
return
False
def
generate_operation_code
(
self
,
code
,
result_code
,
def
generate_operation_code
(
self
,
code
,
result_code
,
...
...
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