Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

Ian Kelly ian.g.kelly at gmail.com
Tue Dec 20 19:03:26 EST 2011


On Tue, Dec 20, 2011 at 12:45 PM, Nathan Rice
<nathan.alexander.rice at gmail.com> wrote:
> There are still some issues with proper support of things like bool()
> and int(), which refuse to return things that are not of the correct
> type.

And that's a good thing.  As type conversion functions, bool(x) and
int(x) should *always* return bools and ints respectively (or raise an
exception), no matter what you pass in for x.

If I do "list(efoo)", where efoo is an ElementwiseProxy object, should
I expect to get the efoo collection converted to a list, or another
ElementwiseProxy where each element has been converted to a list?  I
would hope the former.

> This was developed as a proof of concept for expanding the role of
> element-wise syntax in python, and to that end I welcome comments.

The examples you gave are all numerical in nature.  If I might
inquire, what might I use this for that I can't already do with numpy?

Cheers,
Ian



More information about the Python-list mailing list