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
6a774aad
Commit
6a774aad
authored
Aug 13, 2008
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sage compiles
parent
296cc2df
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
3 deletions
+21
-3
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-2
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+1
-1
Cython/Compiler/Visitor.py
Cython/Compiler/Visitor.py
+4
-0
tests/run/cdef_opt.pxd
tests/run/cdef_opt.pxd
+2
-0
tests/run/cdef_opt.pyx
tests/run/cdef_opt.pyx
+13
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
6a774aad
...
...
@@ -708,8 +708,7 @@ class StringNode(ConstNode):
def
coerce_to
(
self
,
dst_type
,
env
):
if
dst_type
.
is_int
:
if
not
self
.
type
.
is_pyobject
and
len
(
self
.
entry
.
init
)
==
1
:
# we use the *encoded* value here
return
CharNode
(
self
.
pos
,
value
=
self
.
entry
.
init
)
return
CharNode
(
self
.
pos
,
value
=
self
.
value
)
else
:
error
(
self
.
pos
,
"Only coerce single-character ascii strings can be used as ints."
)
return
self
...
...
Cython/Compiler/Parsing.py
View file @
6a774aad
...
...
@@ -1888,7 +1888,7 @@ def p_c_arg_decl(s, ctx, in_pyfunc, cmethod_flag = 0, nonempty = 0, kw_only = 0)
if
'pxd'
in
s
.
level
:
if
s
.
sy
not
in
[
'*'
,
'?'
]:
error
(
pos
,
"default values cannot be specified in pxd files, use ? or *"
)
default
=
1
default
=
ExprNodes
.
BoolNode
(
1
)
s
.
next
()
else
:
default
=
p_simple_expr
(
s
)
...
...
Cython/Compiler/Visitor.py
View file @
6a774aad
...
...
@@ -28,6 +28,10 @@ class BasicVisitor(object):
if
m
is
not
None
:
break
else
:
print
type
(
self
),
type
(
obj
)
print
self
.
access_path
print
self
.
access_path
[
-
1
][
0
].
pos
print
self
.
access_path
[
-
1
][
0
].
__dict__
raise
RuntimeError
(
"Visitor does not accept object: %s"
%
obj
)
self
.
dispatch_table
[
mname
]
=
m
return
m
(
obj
)
...
...
tests/run/cdef_opt.pxd
0 → 100644
View file @
6a774aad
cdef
class
A
:
cpdef
foo
(
self
,
bint
a
=*
,
b
=*
)
tests/run/cdef_opt.pyx
0 → 100644
View file @
6a774aad
__doc__
=
"""
>>> a = A()
>>> a.foo()
(True, 'yo')
>>> a.foo(False)
(False, 'yo')
>>> a.foo(10, 'yes')
(True, 'yes')
"""
cdef
class
A
:
cpdef
foo
(
self
,
bint
a
=
True
,
b
=
"yo"
):
return
a
,
b
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