
What I don’t like about Python - kirubakaran
http://lukepalmer.wordpress.com/2007/04/11/why-i-dont-like-python/
======
pshc
Some of the points are valid, but I'd like to see a follow-up post first once
the author has learned about decorators (and maybe `with` statements).

~~~
d0mine
True.

Here's his examples rewritten in Python (Python is not Ruby despite that both
are nice languages):

    
    
      with atomicio_handler(afile) as handle:
          handle.write("foo")
          if blah:
             raise Exception, "baz"
          handle.write("bar")
    
      with atomicio_handler(afile)  as fh1:
          with atomicio_handler(anotherfile) as fh2:
              ...

------
nihilocrat
_the concept of passing functions (which many programmers are not comfortable
with)_

If this is true, I am apparently quite the programming badass, and so is
anyone who has conquered the "callback function" section of your C textbook of
choice. In some cases, I wouldn't know what to do without them, and I enjoy
the fact that Python makes it seem very natural to be passing them around.

~~~
jamongkad
Well that makes two of us then.

------
anuraggoel
Technical arguments aside, this is one of the most levelheaded
language/framework rants I have seen in a long time. I wish more people ranted
like this. But I guess they wouldn't call it a rant then.

~~~
critic
> I wish more people ranted like this.

Not me. Real rants are more fun to read. cf
<http://linuxhaters.blogspot.com/2009/01/river-of-fail.html>

Yossi already has what's basically a C++ hater's blog.

I'd like to see these for every popular language and platform.

------
llimllib
So, he doesn't like Python because he thinks multi-line lambdas read slightly
better than inline functions? I mean, ok, I don't agree, but whatever.

So why did 26 people vote this up? There's almost no meat to it at all.

~~~
adamc
Presumably, we disagreed with you.

The actual meat, for me, is thinking about how one goal interferes with
another. Not news, but examples are always welcome.

~~~
llimllib
Fair enough, my question was unclear; I wanted to know what people saw in the
article that I didn't.

Thanks for answering my question even though I didn't ask it well.

------
cabalamat
The thing I most dislike about Python is the collection classes aren't
sufficiently orthogonal.

What do I mean? Python has two main built-in collection types, list and dict.
If you have a list you can use "in" to ask whether the list contains a value:

    
    
       >>> a = ['a','b','c']
       >>> 'a' in a
       True
       >>> 'zzz' in a
       False
    

But if you're using a dict, "in" tells you whether the dict's keys contains a
value (not the dict's value).

    
    
       >>> d = {'x':'a', 'y':'b'}
       >>> 'a' in d
       False
       >>> 'x' in d
       True
    

To enumerate over a dict's key-value pairs, you use .items():

    
    
       >>> d.items()
       [('y', 'b'), ('x', 'a')]
    

But to enumerate over the key-value pairs in a list, you have to use
enumerate():

    
    
       >>> list(enumerate(a))
       [(0, 'a'), (1, 'b'), (2, 'c')]

~~~
bhiggins
list and dict are used for completely different reasons and have difference
performance. are you perhaps a php programmer?

~~~
cschep
This is certainly off-topic, but I love even the insults this community
generates.

At least he didn't call anyone out for VB...thems fightin' words.

Zing!

~~~
bhiggins
php doesn't have a seperate list vs. hash type. that's what i'm getting at.
maybe if you knew something about the language you wouldn't have just thought
this was a random insult.

------
ewiethoff
Pedant here. The fact that a Python lambda cannot be multi-line is not
directly related to the whitespace thing. After all, it's easy to put several
statements on one line by separating them with semicolons. No, the issue is, a
Python lambda cannot include any statements; it can only contain an
expression. Expressions and statements are different animals in Python. That's
a fundamental issue.

