[SciPy-dev] Question about 64-bit integers being cast to double precision

Charles R Harris charlesr.harris at gmail.com
Mon Oct 31 11:30:43 CST 2005


On 10/31/05, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
>
> Travis Oliphant wrote:
> > Fernando Perez wrote:
>
> >>Since the 'mental slot' is already in scipy's users heads for saying
> 'modify
> >>the default output of this function to accumulate/store data in a
> different
> >>type', I think it would be reasonable to offer
> >>
> >>sqrt(a,rtype=float)
> >>
> >>
> >
> > One thing we could do is take advantage of the "indexing capabilities"
> > of the ufunc object which are unused at the moment and do something like
> >
> > sqrt[float](a)
> >
> > Where the argument to the index would be the desired output type or
> > something.
>
> This one is a bit intriguing. I kind of like it, but I worry that it's a
> bit
> too unique of a usage. I've never seen this kind of use elsewhere in
> python
> code 'in the wild', and I wonder if it's not too orthogonal to common
> usage to
> force people to learn this particular special case.
>

I kind of like it too. I'm not to worried about the special usage case
because controlling types in python is itself a special usage. I guess
another question is why the indexing capability was originally added.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-dev/attachments/20051031/82a9e89f/attachment.html 


More information about the Scipy-dev mailing list