Comment 6 for bug 355837

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

On Tue, Apr 7, 2009 at 19:08, Fernando Perez <email address hidden> wrote:
> The problem is due to how IPython allows for dynamic prompts.  The
> prompt expression must be eval'ed in the user namespace, so you can put
> what you want in that prompt.  But that means that the user namespace
> can't contain 'str' as a variable, because then doing
>
> str(prompt_expr)
>
> won't work when executed in the user's namespace.
>
> That expression is by default:
>
> <ItplNS '${self.col_p2}.${"."*len(str(self.cache.prompt_count))}.:
> $self.col_norm' >)
>
> so if you also define 'len' to be something other than the builtin, you
> get a similar error.

__builtins__.len(__builtins__.str(...)) perhaps?

--
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