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
6363c558
Commit
6363c558
authored
Aug 29, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Plain Diff
merge from stable
parents
f40c9690
55cf301b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
2 deletions
+40
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+2
-2
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+4
-0
tests/run/listcomp.pyx
tests/run/listcomp.pyx
+16
-0
tests/run/longlongindex.pyx
tests/run/longlongindex.pyx
+18
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
6363c558
...
...
@@ -1423,7 +1423,7 @@ class IndexNode(ExprNode):
elif
not
skip_child_analysis
:
self
.
index
.
analyse_types
(
env
)
if
self
.
base
.
type
.
is_pyobject
:
if
self
.
index
.
type
.
is_int
:
if
self
.
index
.
type
.
is_int
and
not
self
.
index
.
type
.
is_longlong
:
self
.
original_index_type
=
self
.
index
.
type
self
.
index
=
self
.
index
.
coerce_to
(
PyrexTypes
.
c_py_ssize_t_type
,
env
).
coerce_to_simple
(
env
)
if
getting
:
...
...
@@ -2619,7 +2619,7 @@ class ListComprehensionAppendNode(ExprNode):
self
.
is_temp
=
1
def
generate_result_code
(
self
,
code
):
code
.
putln
(
"%s = PyList_Append(%s, %s); %s"
%
code
.
putln
(
"%s = PyList_Append(%s,
(PyObject*)
%s); %s"
%
(
self
.
result_code
,
self
.
target
.
result_code
,
self
.
expr
.
result_code
,
...
...
Cython/Compiler/PyrexTypes.py
View file @
6363c558
...
...
@@ -29,6 +29,7 @@ class PyrexType(BaseType):
# is_extension_type boolean Is a Python extension type
# is_numeric boolean Is a C numeric type
# is_int boolean Is a C integer type
# is_longlong boolean Is a long long or unsigned long long.
# is_float boolean Is a C floating point type
# is_void boolean Is the C void type
# is_array boolean Is a C array type
...
...
@@ -79,6 +80,7 @@ class PyrexType(BaseType):
is_builtin_type
=
0
is_numeric
=
0
is_int
=
0
is_longlong
=
0
is_float
=
0
is_void
=
0
is_array
=
0
...
...
@@ -553,12 +555,14 @@ class CULongType(CUIntType):
class
CLongLongType
(
CUIntType
):
is_longlong
=
1
to_py_function
=
"PyLong_FromLongLong"
from_py_function
=
"__pyx_PyInt_AsLongLong"
class
CULongLongType
(
CUIntType
):
is_longlong
=
1
to_py_function
=
"PyLong_FromUnsignedLongLong"
from_py_function
=
"__pyx_PyInt_AsUnsignedLongLong"
...
...
tests/run/listcomp.pyx
0 → 100644
View file @
6363c558
u"""
>>> smoketest()
[0, 4, 8]
>>> typed()
[A, A, A]
"""
def
smoketest
():
print
[
x
*
2
for
x
in
range
(
5
)
if
x
%
2
==
0
]
cdef
class
A
:
def
__repr__
(
self
):
return
"A"
def
typed
():
cdef
A
obj
print
[
obj
for
obj
in
[
A
(),
A
(),
A
()]]
\ No newline at end of file
tests/run/longlongindex.pyx
0 → 100644
View file @
6363c558
__doc__
=
"""
>>> D = set_longlong(2**40, 2**50, 2, "yelp")
>>> D[2**40]
'yelp'
>>> D[2**50]
'yelp'
>>> D[2]
'yelp'
"""
ctypedef
long
long
foo
def
set_longlong
(
long
long
ob
,
foo
x
,
long
y
,
val
):
tank
=
{}
tank
[
ob
]
=
val
tank
[
x
]
=
val
tank
[
y
]
=
val
return
tank
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