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
7e1933c7
Commit
7e1933c7
authored
Mar 14, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ticket #128: disable Cython type declarations in signatures of .py files
parent
abb7a118
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+10
-2
Cython/Compiler/Scanning.pxd
Cython/Compiler/Scanning.pxd
+1
-0
Cython/Compiler/Scanning.py
Cython/Compiler/Scanning.py
+2
-0
No files found.
Cython/Compiler/Parsing.py
View file @
7e1933c7
...
...
@@ -2089,9 +2089,17 @@ def p_c_arg_decl(s, ctx, in_pyfunc, cmethod_flag = 0, nonempty = 0, kw_only = 0)
pos
=
s
.
position
()
not_none
=
0
default
=
None
if
s
.
in_python_file
:
# empty type declaration
base_type
=
Nodes
.
CSimpleBaseTypeNode
(
pos
,
name
=
None
,
module_path
=
[],
is_basic_c_type
=
0
,
signed
=
0
,
complex
=
0
,
longness
=
0
,
is_self_arg
=
cmethod_flag
,
templates
=
None
)
else
:
base_type
=
p_c_base_type
(
s
,
cmethod_flag
,
nonempty
=
nonempty
)
declarator
=
p_c_declarator
(
s
,
ctx
,
nonempty
=
nonempty
)
if
s
.
sy
==
'not'
:
if
s
.
sy
==
'not'
and
not
s
.
in_python_file
:
s
.
next
()
if
s
.
sy
==
'IDENT'
and
s
.
systring
==
'None'
:
s
.
next
()
...
...
Cython/Compiler/Scanning.pxd
View file @
7e1933c7
...
...
@@ -13,6 +13,7 @@ cdef class PyrexScanner(Scanner):
cdef
public
bint
compile_time_eval
cdef
public
bint
compile_time_expr
cdef
public
bint
parse_comments
cdef
public
bint
in_python_file
cdef
public
source_encoding
cdef
set
keywords
cdef
public
list
indentation_stack
...
...
Cython/Compiler/Scanning.py
View file @
7e1933c7
...
...
@@ -255,8 +255,10 @@ class PyrexScanner(Scanner):
self
.
parse_comments
=
parse_comments
self
.
source_encoding
=
source_encoding
if
filename
.
is_python_file
():
self
.
in_python_file
=
True
self
.
keywords
=
cython
.
set
(
py_reserved_words
)
else
:
self
.
in_python_file
=
False
self
.
keywords
=
cython
.
set
(
pyx_reserved_words
)
self
.
trace
=
trace_scanner
self
.
indentation_stack
=
[
0
]
...
...
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