Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #17627 > unrolled thread

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

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2011-12-20 17:03 -0700
Last post2011-12-21 23:08 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python. Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-20 17:03 -0700
    Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python. Hans Mulder <hansmu@xs4all.nl> - 2011-12-21 23:08 +0100

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

FromIan Kelly <ian.g.kelly@gmail.com>
Date2011-12-20 17:03 -0700
SubjectRe: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.
Message-ID<mailman.3888.1324425839.27778.python-list@python.org>
On Tue, Dec 20, 2011 at 12:45 PM, Nathan Rice
<nathan.alexander.rice@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

[toc] | [next] | [standalone]


#17704

FromHans Mulder <hansmu@xs4all.nl>
Date2011-12-21 23:08 +0100
Message-ID<4ef258d4$0$6981$e4fe514c@news2.news.xs4all.nl>
In reply to#17627
On 21/12/11 01:03:26, Ian Kelly wrote:
> 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.

That doesn't always happen in 2.x:

 >>> type(int(1e42))
<type 'long'>

This was fixed in 3.0.

-- HansM

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web