Common Python Idioms

George Sakkis george.sakkis at gmail.com
Thu Dec 7 16:52:33 EST 2006


Danny Colligan wrote:
> > Is there a list somewhere listing those not-so-obvious-idioms?
>
> I don't know about lists of not-so-obvious idioms, but here's some
> gotchas (there may be some overlap with what you're asking about):
>
> http://zephyrfalcon.org/labs/python_pitfalls.html
> http://www.ferg.org/projects/python_gotchas.html
> http://www.onlamp.com/pub/a/python/2004/02/05/learn_python.html
>
> Danny

I'm surprized that none of these pages mentions the incompatible type
comparison gotcha:

>>> 5 < "4"
True

I'm sure this has bitten many folks, particularly (ex) Perl'ers.

George




More information about the Python-list mailing list