On May 24, 2008, at 7:08 PM, Greg Ewing wrote:

> Why do you want to overload based on return type
> anyway?
>
> I don't see any need to do that in the case of
> __getitem__. That fits perfectly well into the
> usual model of parametric polymorphism -- the
> return type is the same as the element type of
> the array.
>
> If it's used in a context where a different type
> is required, ordinary coercion will take care
> of that.

The specific use case here is NumPy arrays, which may return  
different types for __getitem__. This should be determined at compile  
time by information attached to the ndarray type. I am sure there is  
a cleaner way to do this. Regarding your remarks on Haskell, that  
seems like a much saner approach.

- Robert


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

Reply via email to