Hi,
Dag Sverre Seljebotn wrote:
> I'm thinking about letting the class author specify default buffer
> options. Something like this:
>
> cdef extern class Image ...:
> __cythonbufferdefaults__ = {'ndim' : 2}
> __cythonbuffermandatory__ = {'dtype': unsigned char, indirect=True}
> __cythonbufferalways__ = True
I think default buffer options (mainly a default buffer layout) makes sense in
general. It's basically saying "when I return a buffer, it will look like this".
I wonder about the syntax, though. Wouldn't one special name + a couple of
keyword arguments be enough?
What about specifying it like this:
cdef extern class Image ...:
buffer[...buffer args...] __getbuffer__(...)
?
Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev