Why functional Python matters
jack at performancedrivers.com
Wed Apr 16 03:54:07 CEST 2003
On Tue, Apr 15, 2003 at 11:04:06PM -0000, Dave Benjamin wrote:
> But, there is of course the risk of setting precedent that there are more
> than one ways to do it, and this is why I brought up Perl. I think that
> there is a subtle fear in the Python community of letting Python become too
> much like Perl, especially since both languages have similar application
> domains. There are other options besides TMTOWTDI and military rigor. This
> is precisely why I like Python, because it seems to be a good compromise
> between the two.
No problem, lets just yank out list comprehensions :)
list comps versus map/filter comes down to personal preference and coding
style. I like map & filter.
fearing TMTOWTDI is good, but python hasn't fallen down because people can
write abominations like
i = 0
sum = 0
while (i < len(mylist)):
sum = sum + mylist[i]
i = i + 1
at a guess most people do
sum = 0
for (guy) in mylist:
sum += guy
or my favorite
sum = reduce(int.__add__, mylist, 0) # forget that zero at your peril
TOOWTDI when overdone makes for a bondage and discipline language.
The BDFL gets to decide the balance, sometimes with people whispering in his
ear, and sometimes with people screaming.
The ternary vote thing was more like a room full of crazy homeless people
talking to themselves.
More information about the Python-list