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
18bc21f1
Commit
18bc21f1
authored
Jun 26, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified the first example of fused types.
parent
084a25f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
docs/examples/userguide/fusedtypes/char_or_float.pyx
docs/examples/userguide/fusedtypes/char_or_float.pyx
+4
-5
No files found.
docs/examples/userguide/fusedtypes/char_or_float.pyx
View file @
18bc21f1
from
__future__
import
print_function
cimport
cython
ctypedef
fused
char_or_float
:
c
ython
.
c
har
cython
.
float
char
float
cpdef
char_or_float
plus_one
(
char_or_float
var
):
...
...
@@ -12,7 +11,7 @@ cpdef char_or_float plus_one(char_or_float var):
def
show_me
():
cdef
:
c
ython
.
c
har
a
=
127
cython
.
float
b
=
127
char
a
=
127
float
b
=
127
print
(
'char'
,
plus_one
(
a
))
print
(
'float'
,
plus_one
(
b
))
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