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
949b4133
Commit
949b4133
authored
Oct 29, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.27.x'
parents
5e6ca038
eb270f7e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
CHANGES.rst
CHANGES.rst
+3
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+5
-0
tests/run/pure.pyx
tests/run/pure.pyx
+20
-0
No files found.
CHANGES.rst
View file @
949b4133
...
...
@@ -50,6 +50,9 @@ Other changes
Bugs fixed
----------
* String forward references to extension types like ``@cython.locals(x="ExtType")``
failed to find the named type. (Github issue #1962)
* NumPy slicing generated incorrect results when compiled with Pythran.
(Github issue #1946)
...
...
Cython/Compiler/ExprNodes.py
View file @
949b4133
...
...
@@ -1362,6 +1362,11 @@ def _analyse_name_as_type(name, pos, env):
type
=
PyrexTypes
.
parse_basic_type
(
name
)
if
type
is
not
None
:
return
type
global_entry
=
env
.
global_scope
().
lookup_here
(
name
)
if
global_entry
and
global_entry
.
type
and
global_entry
.
type
.
is_extension_type
:
return
global_entry
.
type
from
.TreeFragment
import
TreeFragment
with
local_errors
(
ignore
=
True
):
pos
=
(
pos
[
0
],
pos
[
1
],
pos
[
2
]
-
7
)
...
...
tests/run/pure.pyx
View file @
949b4133
...
...
@@ -160,3 +160,23 @@ def test_declare_c_types(n):
#z01 = cython.declare(cython.floatcomplex, n+1j)
#z02 = cython.declare(cython.doublecomplex, n+1j)
#z03 = cython.declare(cython.longdoublecomplex, n+1j)
cdef
class
ExtType
:
"""
>>> x = ExtType()
>>> x.forward_ref(x)
'ExtType'
"""
@
cython
.
locals
(
x
=
"ExtType"
)
def
forward_ref
(
self
,
x
):
return
cython
.
typeof
(
x
)
def
ext_type_string_ref
(
x
:
"ExtType"
):
"""
>>> x = ExtType()
>>> ext_type_string_ref(x)
'ExtType'
"""
return
cython
.
typeof
(
x
)
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