Dot product?

Mike Fletcher mfletch at tpresence.com
Sun Dec 12 18:31:18 EST 1999


(Prying dang tongue from cheek for a few seconds, blighter keeps getting
caught in there)...

The rebelliousness was related to the use of map and reduce, both of which
are considered "evil"[1]  by the powers that be (PTB).  Those same PTB's
have expressed interest in the list comprehensions.  I was merely hoping to
prevent middle-of-the-night visits by the Python Purity League (PPL) in
retribution for putting forth methods of computation based on these satanic
devices.

In reality, I have no expectation of seeing map/reduce disappear in 1.6.  I
suppose the PTBs might declare a jihad and demand that all Loyal Followers
of the Python (LFOTP) mount Arabian text editors and sweep the disbelieving
functions from all code for version 2.0, but the Greater Ethos of Python
(GEOP) tends to suggest not crippling massive quantities of code for the
sake of ideological purity.

The silliness was "this is a simple one-line function which slows us down
considerably."  (It didn't even occur to me to wrap it into a function until
I'd already copied the text into the message and realised you'd asked for it
as such.) So I felt silly incurring an extra function call just to
re-package the arguments to map.  Of course, the true LFOTP will call down
fire upon my head for using an obscure-and-little-known feature instead of a
readily understood function call.  We Demons of Easy to Write but Speedy
Computation (DOETWBSC) often offend the GEOP as we slavishly eke the golden
elixir* with our evil inline expansions, maps, and algorithmic impurity.

The DOETWBSC shall not cease our fight, the PPL cannot continue its reign of
terror, nor should the LFOTP stand aside as our fledgling brotherhood is
trampled beneath the heel of the PTB in contradiction to the very core of
the GEOP. Rage against the slowness of the night!

[1] unclear/non-intuitive, as declared by the council at Pythonica
[2] CPU cycles, [Speedicus Markupicus Ch2v35]

-----Original Message-----
From: David C. Ullrich [mailto:ullrich at math.okstate.edu]
Sent: Sunday, December 12, 1999 2:52 PM
To: python-list at python.org
Subject: Re: Dot product?
...
> Maybe not what you were asking, but some food for thought :) .  Of course,
> we're told that all this mapping and reducing will get replaced by list
> comprehensions, so maybe I shouldn't post this...

    I haven't been paying close enough attention to know what you mean
by that - it's going to be replaced in the next version, or it's going to be
replaced by the interpreter on compile?

    So I dunno what's so rebellious about your post. I do want a Transpose
fairly regularly, and it seems to me that getting my Transose from one
call to one built-in function must be at least as efficient as the code I'm
not willing to show you that did it by hand.(???)

...
   Don't seem so silly to me - for the second between the time when I
saw the Transpose(a,b) and the time I saw this I was planning on
figuring out how to make it work for any number of sequences.
(Pretty sure I could got that one, having seen how to do it for two...)
...




More information about the Python-list mailing list