Yes, it's probably an unnecessary optimisation assuming sparse.data is small.  I've just been doing some Cython reading and wondered. Here's a gist: https://gist.github.com/jnothman/6915908