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
bd1645a8
Commit
bd1645a8
authored
May 04, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
merged in latest cython-devel
parents
1e544e4d
14acb834
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+3
-0
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+9
-1
No files found.
Cython/Compiler/Parsing.py
View file @
bd1645a8
...
...
@@ -1576,6 +1576,9 @@ def p_statement(s, ctx, first_statement = 0):
decorators
=
p_decorators
(
s
)
if
s
.
sy
not
in
(
'def'
,
'cdef'
,
'cpdef'
):
s
.
error
(
"Decorators can only be followed by functions "
)
elif
s
.
sy
==
'pass'
and
cdef_flag
:
# empty cdef block
return
p_pass_statement
(
s
,
with_newline
=
1
)
overridable
=
0
if
s
.
sy
==
'cdef'
:
...
...
Cython/Compiler/PyrexTypes.py
View file @
bd1645a8
...
...
@@ -275,8 +275,14 @@ class BuiltinObjectType(PyObjectType):
base_type
=
None
module_name
=
'__builtin__'
alternative_name
=
None
# used for str/bytes duality
def
__init__
(
self
,
name
,
cname
):
self
.
name
=
name
if
name
==
'str'
:
self
.
alternative_name
=
'bytes'
elif
name
==
'bytes'
:
self
.
alternative_name
=
'str'
self
.
cname
=
cname
self
.
typeptr_cname
=
"&"
+
cname
...
...
@@ -293,7 +299,9 @@ class BuiltinObjectType(PyObjectType):
def
assignable_from
(
self
,
src_type
):
if
isinstance
(
src_type
,
BuiltinObjectType
):
return
src_type
.
name
==
self
.
name
return
src_type
.
name
==
self
.
name
or
(
src_type
.
name
==
self
.
alternative_name
and
src_type
.
name
is
not
None
)
else
:
return
not
src_type
.
is_extension_type
...
...
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