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
Boxiang Sun
cython
Commits
2c4afc4b
Commit
2c4afc4b
authored
Aug 11, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix builtin bool tests.
parent
510c6653
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
tests/run/cdef_bool_T227.pyx
tests/run/cdef_bool_T227.pyx
+2
-0
tests/run/isinstance.pyx
tests/run/isinstance.pyx
+4
-4
tests/run/type_inference.pyx
tests/run/type_inference.pyx
+3
-1
No files found.
tests/run/cdef_bool_T227.pyx
View file @
2c4afc4b
from
cpython.bool
cimport
bool
def
foo
(
bool
a
):
"""
>>> foo(True)
...
...
tests/run/isinstance.pyx
View file @
2c4afc4b
cimport
cython
from
cpython.bool
cimport
bool
cdef
class
A
:
pass
...
...
@@ -33,7 +34,7 @@ def test_optimised():
# Optimized tests.
assert
isinstance
(
new_type
,
type
)
assert
isinstance
(
bool
()
,
bool
)
assert
isinstance
(
True
,
bool
)
assert
isinstance
(
int
(),
int
)
assert
isinstance
(
long
(),
long
)
assert
isinstance
(
float
(),
float
)
...
...
@@ -58,9 +59,8 @@ def test_optimised_tuple():
>>> test_optimised_tuple()
True
"""
assert
isinstance
(
bool
(),
(
bool
,
int
,
long
,
float
,
bytes
,
str
,
unicode
,
tuple
,
list
,
dict
,
set
,
slice
))
assert
isinstance
(
int
(),
(
bool
,
int
,
long
,
float
,
bytes
,
str
,
unicode
,
tuple
,
list
,
dict
,
set
,
slice
))
assert
isinstance
(
list
(),
(
bool
,
int
,
long
,
float
,
bytes
,
str
,
unicode
,
tuple
,
list
,
dict
,
set
,
slice
))
assert
isinstance
(
int
(),
(
int
,
long
,
float
,
bytes
,
str
,
unicode
,
tuple
,
list
,
dict
,
set
,
slice
))
assert
isinstance
(
list
(),
(
int
,
long
,
float
,
bytes
,
str
,
unicode
,
tuple
,
list
,
dict
,
set
,
slice
))
return
True
@
cython
.
test_assert_path_exists
(
'//SimpleCallNode//SimpleCallNode'
)
...
...
tests/run/type_inference.pyx
View file @
2c4afc4b
...
...
@@ -4,6 +4,8 @@
cimport
cython
from
cython
cimport
typeof
,
infer_types
from
cpython
cimport
bool
##################################################
# type inference tests in 'full' mode
...
...
@@ -48,7 +50,7 @@ def builtin_types():
d
=
dict
()
assert
typeof
(
d
)
==
"dict object"
,
typeof
(
d
)
B
=
bool
()
assert
typeof
(
B
)
==
"bool
object
"
,
typeof
(
B
)
assert
typeof
(
B
)
==
"bool"
,
typeof
(
B
)
def
slicing
():
"""
...
...
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