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
22ddeca8
Commit
22ddeca8
authored
Jan 12, 2019
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Py3 syntax in generated Cython code fragment.
parent
cf0b7a51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
Cython/Utility/TestCythonScope.pyx
Cython/Utility/TestCythonScope.pyx
+14
-11
No files found.
Cython/Utility/TestCythonScope.pyx
View file @
22ddeca8
########## TestClass ##########
########## TestClass ##########
# These utilities are for testing purposes
# These utilities are for testing purposes
from
__future__
import
print_function
cdef
extern
from
*
:
cdef
extern
from
*
:
cdef
object
__pyx_test_dep
(
object
)
cdef
object
__pyx_test_dep
(
object
)
...
@@ -15,29 +17,29 @@ cdef class TestClass(object):
...
@@ -15,29 +17,29 @@ cdef class TestClass(object):
return
'TestClass(%d)'
%
self
.
value
return
'TestClass(%d)'
%
self
.
value
cdef
cdef
_method
(
self
,
int
value
):
cdef
cdef
_method
(
self
,
int
value
):
print
'Hello from cdef_method'
,
value
print
(
'Hello from cdef_method'
,
value
)
cpdef
cpdef
_method
(
self
,
int
value
):
cpdef
cpdef
_method
(
self
,
int
value
):
print
'Hello from cpdef_method'
,
value
print
(
'Hello from cpdef_method'
,
value
)
def
def_method
(
self
,
int
value
):
def
def_method
(
self
,
int
value
):
print
'Hello from def_method'
,
value
print
(
'Hello from def_method'
,
value
)
@
cname
(
'cdef_cname'
)
@
cname
(
'cdef_cname'
)
cdef
cdef
_cname_method
(
self
,
int
value
):
cdef
cdef
_cname_method
(
self
,
int
value
):
print
"Hello from cdef_cname_method"
,
value
print
(
"Hello from cdef_cname_method"
,
value
)
@
cname
(
'cpdef_cname'
)
@
cname
(
'cpdef_cname'
)
cpdef
cpdef
_cname_method
(
self
,
int
value
):
cpdef
cpdef
_cname_method
(
self
,
int
value
):
print
"Hello from cpdef_cname_method"
,
value
print
(
"Hello from cpdef_cname_method"
,
value
)
@
cname
(
'def_cname'
)
@
cname
(
'def_cname'
)
def
def_cname_method
(
self
,
int
value
):
def
def_cname_method
(
self
,
int
value
):
print
"Hello from def_cname_method"
,
value
print
(
"Hello from def_cname_method"
,
value
)
@
cname
(
'__pyx_test_call_other_cy_util'
)
@
cname
(
'__pyx_test_call_other_cy_util'
)
cdef
test_call
(
obj
):
cdef
test_call
(
obj
):
print
'test_call'
print
(
'test_call'
)
__pyx_test_dep
(
obj
)
__pyx_test_dep
(
obj
)
@
cname
(
'__pyx_TestClass_New'
)
@
cname
(
'__pyx_TestClass_New'
)
...
@@ -46,19 +48,20 @@ cdef _testclass_new(int value):
...
@@ -46,19 +48,20 @@ cdef _testclass_new(int value):
########### TestDep ##########
########### TestDep ##########
from
__future__
import
print_function
@
cname
(
'__pyx_test_dep'
)
@
cname
(
'__pyx_test_dep'
)
cdef
test_dep
(
obj
):
cdef
test_dep
(
obj
):
print
'test_dep'
,
obj
print
(
'test_dep'
,
obj
)
########## TestScope ##########
########## TestScope ##########
@
cname
(
'__pyx_testscope'
)
@
cname
(
'__pyx_testscope'
)
cdef
object
_testscope
(
int
value
):
cdef
object
_testscope
(
int
value
):
return
"hello from cython scope, value=%d"
%
value
return
f"hello from cython scope, value=
{
value
}
"
########## View.TestScope ##########
########## View.TestScope ##########
@
cname
(
'__pyx_view_testscope'
)
@
cname
(
'__pyx_view_testscope'
)
cdef
object
_testscope
(
int
value
):
cdef
object
_testscope
(
int
value
):
return
"hello from cython.view scope, value=%d"
%
value
return
f"hello from cython.view scope, value=
{
value
}
"
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