[Tutor] str object is not callable
Brian van den Broek
brian.van.den.broek at gmail.com
Tue Jul 10 18:19:10 CEST 2012
On 10 Jul 2012 11:31, "Chris Hare" <chare at labr.net> wrote:
>
>
> This piece of code works:
>
> Big-Mac:Classes chare$ more tmp.py
> import re
>
<snip>
> return not bool(search(string))
<snip>
> However, when I use the EXACT same code in the context of the larger
code, I get the error
>
> return not bool(search(strg))
In addition to the comments about likely shaddowing, contrary to what you
say, those two lines are not the same. Either you retyped instead of copy &
pasting (don't do that), or you are not running the code you think you are.
Best,
Brian vdB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120710/afe8baaa/attachment.html>
More information about the Tutor
mailing list