Commit ea539d24 authored by Stefan Behnel's avatar Stefan Behnel

added test to make sure 'type' works as argument type

parent a7e8cd06
...@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment