In article <[EMAIL PROTECTED]>, George Sakkis <[EMAIL PROTECTED]> wrote: > >I had probably stumbled on many/most of the common pitfalls usually >mentioned (e.g. http://www.ferg.org/projects/python_gotchas.html, >http://zephyrfalcon.org/labs/python_pitfalls.html) while learning, but >picked them up easily after the first or second time. Off the top of >my head, two errors that keep coming back even years after are: >- Comparing instances of (semantically) incomparable types (http:// >www.ibm.com/developerworks/library/l-python-elegance-1.html). >Thankfully this will be fixed in Py3k. >- Strings being iterable; unfortunately this will stay in Py3K.
I'll repeat the comment I made on python-3000: "...string iteration isn't about treating strings as sequences of strings, it's about treating strings as sequences of characters. The fact that characters are also strings is the reason we have problems, but characters are strings for other good reasons." Thing is, the fact that you can e.g. slice strings just like other sequence types creates the consequence that you can also iterate over strings -- moreover, some of us actually do iterate over strings (though of course we could if necessary create lists/tuples of characters). In the grand scheme of things, I rarely see people running into problems with iterating over strings. -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "as long as we like the same operating system, things are cool." --piranha -- http://mail.python.org/mailman/listinfo/python-list