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
ea539d24
Commit
ea539d24
authored
Jul 23, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test to make sure 'type' works as argument type
parent
a7e8cd06
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
tests/run/builtin_type.pyx
tests/run/builtin_type.pyx
+13
-0
No files found.
tests/run/builtin_type.pyx
View file @
ea539d24
...
@@ -38,3 +38,16 @@ def type_type():
...
@@ -38,3 +38,16 @@ def type_type():
True
True
"""
"""
return
type
return
type
cpdef
type
pass_type
(
type
x
):
"""
>>> pass_type(int) == int
True
>>> class MyType(object): pass
>>> pass_type(MyType) == MyType
True
>>> pass_type(object())
Traceback (most recent call last):
TypeError: Argument 'x' has incorrect type (expected type, got object)
"""
return
x
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