Commit 1752ae4e authored by gsamain's avatar gsamain

cypclass typecast unit test

parent a9e92a10
cdef cypclass SomeMemory:
int a
unsigned int __unsigned_int__(self):
return <unsigned int> self.a
int __int__(self):
return self.a
cpdef bag():
cdef SomeMemory o = SomeMemory()
o.a = -1
return str(<int> o) + '\n' + str(<unsigned int> o)
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
setup(
ext_modules = cythonize([
Extension(
'cypclass_test_typecast',
language='c++',
sources=['cypclass_test_typecast.pyx'],
extra_compile_args=["-pthread", "-std=c++11"],
),
])
)
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