why python annoys me

Oliver Korpilla korpo at 01019freenet.de
Fri Apr 20 23:01:22 EDT 2001


>

> Python does not force you in thinking OO, procedural or functional.
> That's what I ment.

What about functional ? Pyhon doesn't either ENABLE you to work functional!!
apply, filter and map are 3 nice functions, and the data types are nice, too,
but without list comprehension or partial applicatiob, curried function etc.
you can't use them that much neither...

Haskell Quicksort:
qsort:: Ord a=> [a] -> [a]
qsort [] = []
qsort (x:xs) = [y | y <- xs, y <= x] ++ [x] ++ [y | y <- xs, y > x]

without list comprehension it's impossible (IMHO, of course) to match this
functional elegance. filter could suffice, but without
partial application or the ability to use function-local variables in
lambda-expression definitions, you cannot redo a functional, recursive, pure
solution.
This is just toys! Nice toys, sometimes.
Do not take this as defying Python ! I love it. But keep non-functional, as it
is ;O)

Ciao, Korpo




More information about the Python-list mailing list