Commit 1e402dfa authored by gsamain's avatar gsamain

Enhance typecast test

parent 7c022bd9
......@@ -7,8 +7,22 @@ cdef cypclass SomeMemory:
int __int__(self):
return self.a
bint __bool__(self):
return self.a < 0
cdef cypclass SomeWrapper:
SomeMemory m
void __init__(self, int a=0):
self.m = SomeMemory()
self.m.a = a
SomeMemory __SomeMemory__(self):
return self.m
cpdef bag():
cdef SomeMemory o = SomeMemory()
o.a = -1
return str(<int> o) + '\n' + str(<unsigned int> o)
cdef SomeWrapper w = SomeWrapper(3)
return str(<int> o) + '\n' + str(<unsigned int> o) + '\n' + str(<bint> o)\
+ '\n' + str(<int> <SomeMemory> w)
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