Pseudo-indices -- PEP material?

Magnus Lie Hetland mlh at furu.idi.ntnu.no
Sat Jun 14 09:03:04 EDT 2003


In article <zteGa.283$5Z6.270 at nwrdny03.gnilink.net>, Raymond Hettinger wrote:
>[Magnus Lie Hetland]
>> I've found I kind of like the capability of numarray to use sequences
>> as keys to arrays, e.g:
>
>I like it too.
>Rather, I like it in numarray and am -1 for having in the Python core.

I guess I agree with you. I just sort of panicked when I couldn't
compile numarray ... :]

[snip]

Good arguments.

>Look at the code inside meshgrid() or some of Matlab's other array
>index manipulators.  A little aspirin is a must when dealing with this code.

Hehe.

>2) Equivalent functionality is already available with very few keystrokes:
>
>>>> a = [1,2,3,4]
>>>> map(a.__getitem__, [1,3])
>[2, 4]
>>>> map(a.__setitem__, [0, 3], [5, 6])
>[None, None]
>>>> a
>[5, 2, 3, 6]

Yuck! Faced with this I would much rather use a for loop, after all :)

[snip]
>> this is that I can't get any version of numarray to work with Py3b1 in
>
>Wow, Python 3.0  made it to beta before 2.3 got out.  Go figure ;-)

Heh -- no wonder I couldn't make it <wink>.

>Raymond Hettinger

-- 
Magnus Lie Hetland                "In this house we obey the laws of
http://hetland.org                 thermodynamics!"    Homer Simpson




More information about the Python-list mailing list