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
e896d20f
Commit
e896d20f
authored
Mar 02, 2013
by
Nikita Nemkin
Committed by
Robert Bradshaw
Mar 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed explicit coercion of ctypedef'ed C types.
parent
5b8cccd2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+9
-7
tests/run/ctypedef_delegation.pyx
tests/run/ctypedef_delegation.pyx
+9
-0
No files found.
Cython/Compiler/PyrexTypes.py
View file @
e896d20f
...
...
@@ -295,9 +295,9 @@ def create_typedef_type(name, base_type, cname, is_external=0):
class
CTypedefType
(
BaseType
):
#
# Pseudo-type defined with a ctypedef statement in a
# 'cdef extern from' block.
Delegates most attribute
#
lookups to the base type. ANYTHING NOT DEFINED
#
HERE IS DELEGATED!
# 'cdef extern from' block.
#
Delegates most attribute lookups to the base type.
#
(Anything not defined here or in the BaseType is delegated.)
#
# qualified_name string
# typedef_name string
...
...
@@ -439,6 +439,9 @@ class CTypedefType(BaseType):
def
py_type_name
(
self
):
return
self
.
typedef_base_type
.
py_type_name
()
def
can_coerce_to_pyobject
(
self
,
env
):
return
self
.
typedef_base_type
.
can_coerce_to_pyobject
(
env
)
class
MemoryViewSliceType
(
PyrexType
):
...
...
@@ -774,10 +777,9 @@ class MemoryViewSliceType(PyrexType):
class
BufferType
(
BaseType
):
#
# Delegates most attribute
# lookups to the base type. ANYTHING NOT DEFINED
# HERE IS DELEGATED!
# Delegates most attribute lookups to the base type.
# (Anything not defined here or in the BaseType is delegated.)
#
# dtype PyrexType
# ndim int
# mode str
...
...
tests/run/ctypedef_delegation.pyx
0 → 100644
View file @
e896d20f
ctypedef
char
*
LPSTR
def
typedef_delegation
():
"""
>>> typedef_delegation()
"""
cdef
LPSTR
c_str
=
b"ascii"
assert
<
bytes
>
c_str
==
b"ascii"
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