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
572ec10d
Commit
572ec10d
authored
Jul 09, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let the truth value of cypclass objects fall back on the value of their pointer
parent
e5a59ad5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+5
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
572ec10d
...
...
@@ -1167,6 +1167,11 @@ class ExprNode(Node):
elif
type
.
is_pyobject
or
type
.
is_int
or
type
.
is_ptr
or
type
.
is_float
:
return
CoerceToBooleanNode
(
self
,
env
)
elif
type
.
is_cpp_class
:
if
type
.
is_cyp_class
:
has_bool_operator
=
type
.
scope
.
lookup_here
(
"operator bool"
)
# let cypclass truth-testing fall back on the value of the pointer
if
not
has_bool_operator
:
return
CoerceToBooleanNode
(
self
,
env
)
return
SimpleCallNode
(
self
.
pos
,
function
=
AttributeNode
(
...
...
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