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
036a1810
Commit
036a1810
authored
May 04, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
merged in latest cython-unstable
parents
f17a1512
bd1645a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+2
-2
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/ModuleNode.py
View file @
036a1810
...
@@ -1811,12 +1811,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1811,12 +1811,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
Naming
.
builtins_cname
,
Naming
.
builtins_cname
,
code
.
error_goto
(
self
.
pos
)))
code
.
error_goto
(
self
.
pos
)))
if
Options
.
embed
:
if
Options
.
embed
:
__main__
c
name
=
code
.
globalstate
.
get_py_string_const
(
__main__name
=
code
.
globalstate
.
get_py_string_const
(
EncodedString
(
"__main__"
),
identifier
=
True
)
EncodedString
(
"__main__"
),
identifier
=
True
)
code
.
putln
(
code
.
putln
(
'if (__Pyx_SetAttrString(%s, "__name__", %s) < 0) %s;'
%
(
'if (__Pyx_SetAttrString(%s, "__name__", %s) < 0) %s;'
%
(
env
.
module_cname
,
env
.
module_cname
,
__main__cname
,
__main__
name
.
cname
,
code
.
error_goto
(
self
.
pos
)))
code
.
error_goto
(
self
.
pos
)))
if
Options
.
pre_import
is
not
None
:
if
Options
.
pre_import
is
not
None
:
code
.
putln
(
code
.
putln
(
...
...
Cython/Compiler/Parsing.py
View file @
036a1810
...
@@ -1614,6 +1614,9 @@ def p_statement(s, ctx, first_statement = 0):
...
@@ -1614,6 +1614,9 @@ def p_statement(s, ctx, first_statement = 0):
decorators
=
p_decorators
(
s
)
decorators
=
p_decorators
(
s
)
if
s
.
sy
not
in
(
'def'
,
'cdef'
,
'cpdef'
):
if
s
.
sy
not
in
(
'def'
,
'cdef'
,
'cpdef'
):
s
.
error
(
"Decorators can only be followed by functions "
)
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
overridable
=
0
if
s
.
sy
==
'cdef'
:
if
s
.
sy
==
'cdef'
:
...
...
Cython/Compiler/PyrexTypes.py
View file @
036a1810
...
@@ -275,8 +275,14 @@ class BuiltinObjectType(PyObjectType):
...
@@ -275,8 +275,14 @@ class BuiltinObjectType(PyObjectType):
base_type
=
None
base_type
=
None
module_name
=
'__builtin__'
module_name
=
'__builtin__'
alternative_name
=
None
# used for str/bytes duality
def
__init__
(
self
,
name
,
cname
):
def
__init__
(
self
,
name
,
cname
):
self
.
name
=
name
self
.
name
=
name
if
name
==
'str'
:
self
.
alternative_name
=
'bytes'
elif
name
==
'bytes'
:
self
.
alternative_name
=
'str'
self
.
cname
=
cname
self
.
cname
=
cname
self
.
typeptr_cname
=
"&"
+
cname
self
.
typeptr_cname
=
"&"
+
cname
...
@@ -293,7 +299,9 @@ class BuiltinObjectType(PyObjectType):
...
@@ -293,7 +299,9 @@ class BuiltinObjectType(PyObjectType):
def
assignable_from
(
self
,
src_type
):
def
assignable_from
(
self
,
src_type
):
if
isinstance
(
src_type
,
BuiltinObjectType
):
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
:
else
:
return
not
src_type
.
is_extension_type
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