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
Kirill Smelkov
cython
Commits
ba53f939
Commit
ba53f939
authored
4 years ago
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.29.x'
parents
cdbd7923
8bc46f37
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
CHANGES.rst
CHANGES.rst
+3
-0
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+3
-0
tests/run/if_else_expr.pyx
tests/run/if_else_expr.pyx
+12
-0
No files found.
CHANGES.rst
View file @
ba53f939
...
...
@@ -210,6 +210,9 @@ Bugs fixed
implemented
functions
.
Patch
by
David
Woods
.
(
Github
issue
#
3384
)
*
Using
C
functions
as
temporary
values
lead
to
invalid
C
code
.
Original
patch
by
David
Woods
.
(
Github
issue
#
3418
)
*
Fix
an
unhandled
C
++
exception
in
comparisons
.
Patch
by
David
Woods
.
(
Github
issue
#
3361
)
...
...
This diff is collapsed.
Click to expand it.
Cython/Compiler/Code.py
View file @
ba53f939
...
...
@@ -832,6 +832,9 @@ class FunctionState(object):
type = type.cv_base_type
elif type.is_reference and not type.is_fake_reference:
type = type.ref_base_type
elif type.is_cfunction:
from . import PyrexTypes
type = PyrexTypes.c_ptr_type(type) # A function itself isn'
t
an
l
-
value
if
not
type
.
is_pyobject
and
not
type
.
is_memoryviewslice
:
# Make manage_ref canonical, so that manage_ref will always mean
# a decref is needed.
...
...
This diff is collapsed.
Click to expand it.
tests/run/if_else_expr.pyx
View file @
ba53f939
...
...
@@ -55,3 +55,15 @@ def test_syntax():
y
=
0
if
1.0
else
1
z
=
0
if
1.
else
1
return
x
,
y
,
z
from
libc
cimport
math
def
test_cfunc_ptrs
(
double
x
,
bint
round_down
):
"""
>>> test_cfunc_ptrs(2.5, round_down=True)
2.0
>>> test_cfunc_ptrs(2.5, round_down=False)
3.0
"""
return
(
math
.
floor
if
round_down
else
math
.
ceil
)(
x
)
This diff is collapsed.
Click to expand it.
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