What are the common programming mistakes in Python?
Posted
by Paul McGuire
on Stack Overflow
See other posts from Stack Overflow
or by Paul McGuire
Published on 2010-05-02T14:22:06Z
Indexed on
2010/05/02
14:27 UTC
Read the original article
Hit count: 296
I was about to tag the recent question in which the OP accidentally shadowed the builtin operator
module with his own local operator.py with the "common-mistakes" tag, and I saw that there are a number of interesting questions posted asking for common mistakes to avoid in Java, Ruby, Scala, Clojure, .Net, jQuery, Haskell, SQL, ColdFusion, and so on, but I didn't see any for Python.
For the benefit of Python beginners, can we enumerate the common mistakes that we have all committed at one time or another, in the hopes of maybe steering a newbie or two clear of them? (In homage to "The Princess Bride", I call these the Classic Blunders.) If possible, a little supporting explanation on what the problem is, and the generally accepted resolution/workaround, so that the beginning Pythoner doesn't read your answer and say "ok, that's a mistake, how do I fix it?"
© Stack Overflow or respective owner