The signature of __cinit__ is fixed by that of __init__, i.e. it takes
a variable number of Python objects as arguments. In particular, how
else would it be invokable from Python? What could do here is have the
__cinit__ function callable, creating the empty list (or converting a
Python list into your vector), and then you would have a cdef function
that could take the C++ arguments callable only from other Cython
code. (This could be wrapped in a create_new_hashbits() cdef function
if that's the normal usecase.)
- Robert
That would work well. For even more flexibility, you could even do
def __cinit__(self, WordLength k, primes):
cdef vector[HashIntoType] v = vector[HashIntoType]()
for a in primes:
v.push_back(a)
- Robert