Python Gotcha's?
Jon Clements
joncle at googlemail.com
Thu Apr 5 14:10:51 EDT 2012
On Wednesday, 4 April 2012 23:34:20 UTC+1, Miki Tebeka wrote:
> Greetings,
>
> I'm going to give a "Python Gotcha's" talk at work.
> If you have an interesting/common "Gotcha" (warts/dark corners ...) please share.
>
> (Note that I want over http://wiki.python.org/moin/PythonWarts already).
>
> Thanks,
> --
> Miki
One I've had to debug...
>>> text = 'abcdef'
>>> if text.find('abc'):
print 'found it!'
# Nothing prints as bool(0) is False
>>> if text.find('bob'):
print 'found it!'
found it!
Someone new who hasn't read the docs might try this, but then I guess it's not really a gotcha if they haven't bothered doing that.
More information about the Python-list
mailing list