- Author: DagSverreSeljebotn
- Status: Idea
The former is about declaring the capabilities of the type C-side while the latter will be about declaring what Cython-code should be generated when hitting operators.
The former case is not discussed here, see [:enhancements/cpp: the C++ page]. For the latter case, Python-like syntax is proposed:
cdef class Foo: cdef Foo __add__(self, Foo other): return add_foo(self, other)
add_foo might here be either a declared C function or more Cython code. On this level, any kind of fancy parameters for  is supported, by writing the obvious Cython code to interpret the argument list (as a Python tuple structure).
The normal set of Python binary operators, getitem, setitem etc.
Also some Cython-specific operators are probably wanted for controlling coercion behaviour etc. (similar to C++ cast operators).