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
ae59c5a0
Commit
ae59c5a0
authored
Apr 27, 2011
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compiler crash with type inferencing and add all() and any() to Utils
parent
cbc3ddcf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
11 deletions
+21
-11
Cython/Compiler/TypeInference.py
Cython/Compiler/TypeInference.py
+1
-1
Cython/Distutils/build_ext.py
Cython/Distutils/build_ext.py
+2
-10
Cython/Utils.py
Cython/Utils.py
+18
-0
No files found.
Cython/Compiler/TypeInference.py
View file @
ae59c5a0
...
...
@@ -270,7 +270,7 @@ class SimpleAssignmentTypeInferer(object):
while
ready_to_infer
:
entry
=
ready_to_infer
.
pop
()
types
=
[
expr
.
infer_type
(
scope
)
for
expr
in
entry
.
assignments
]
if
types
:
if
Utils
.
all
(
types
)
:
entry
.
type
=
spanning_type
(
types
,
entry
.
might_overflow
)
else
:
# FIXME: raise a warning?
...
...
Cython/Distutils/build_ext.py
View file @
ae59c5a0
...
...
@@ -19,6 +19,8 @@ from distutils.dir_util import mkpath
from
distutils.command
import
build_ext
as
_build_ext
from
distutils
import
sysconfig
from
Cython.Utils
import
any
extension_name_re
=
_build_ext
.
extension_name_re
show_compilers
=
_build_ext
.
show_compilers
...
...
@@ -55,16 +57,6 @@ class Optimization(object):
optimization
=
Optimization
()
try
:
any
except
NameError
:
def
any
(
it
):
for
x
in
it
:
if
x
:
return
True
return
False
class
build_ext
(
_build_ext
.
build_ext
):
...
...
Cython/Utils.py
View file @
ae59c5a0
...
...
@@ -221,3 +221,21 @@ def none_or_sub(s, data):
else
:
return
s
%
data
# all() and any() are new in 2.5
try
:
# Make sure to bind them on the module, as they will be accessed as
# attributes
all
=
all
any
=
any
except
NameError
:
def
all
(
items
):
for
item
in
items
:
if
not
item
:
return
False
return
True
def
any
(
items
):
for
item
in
items
:
if
item
:
return
True
return
False
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