Comment 2 for bug 355837

Revision history for this message
Robert Kern (robert-kern) wrote : Re: [Bug 355837] [NEW] error message "str object not callable" when not calling string

On Sun, Apr 5, 2009 at 18:34, Brian Granger <email address hidden> wrote:
> str is a Python built-in.  You reassign it to a string.  Because
> IPython uses the str builtin internally, things go bad in a serious
> way.  This is probably called by readline as you type.  This is not an
> IPython bug.  Just don't use built-in names for your own variables.

It's probably worth looking into, though. Why does IPython evaluate
'str' in the user's namespace? Assigning to 'str' in the user's
namespace certainly doesn't affect the __builtins__ (if it did, that's
definitely a bug!)

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco