The trick to supporting things like foo[i][j] is to
give foo a __getitem__ method that returns an intermediate
object representing a row. The row object holds a reference
to the original matrix object, and enough information to
locate the row of interest within it. You then give the
row object __getitem__ and __setitem__ methods that
access an element of the row.

It's a fair amount of work to set up, but it's the only
way if you can't make use of something like numpy that
already does it for you.

-- 
Greg
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to