Commit 4ac6b279 authored by gsamain's avatar gsamain

Cypclass (basic) template test

parent 22448747
cdef cypclass SomeMemory[T, U]:
T a
U b
void __init__(self, T a, U b):
self.a = a
self.b = b
T first(self):
return self.a
U second(self):
return self.b
cpdef bag():
cdef SomeMemory[int, double] o = SomeMemory[int, double](1, 2.3)
return str(o.a) + '\n' + str(o.b) + '\n' + str(o.first()) + '\n' + str(o.second())
\ No newline at end of file
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
setup(
ext_modules = cythonize([
Extension(
'cypclass_test_templates',
language='c++',
sources=['cypclass_test_templates.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