[Zope] object of type 'string' is not callable
Paul Winkler
pw_lists@slinkp.com
Wed, 18 Jun 2003 05:56:08 -0400
On Wed, Jun 18, 2003 at 10:30:05AM +0200, Geir B?kholt wrote:
> On Wed, 18 Jun 2003 16:30:54 +1000 GMT (..8:30 where i live(GMT+2) )
> drew nichols asked the Zope mailinglist about the following:
>
>
> > "object of type 'string' is not callable"
>
> > what does this error really mean
>
>
>
> > class myClass ( simpleItem ):
>
> > def stringify( self ):
> > str = "\nLogins: " + str( ['ello'] )
>
> could it be the fact that you are redfining str to be a string
> before calling it as a method ?
not in the example as given... remember that the right-hand side
of an assignment is evaluated before the assignment takes place.
And just to quibble, str() is a function, not a method.
but if the actual stringify method uses str() multiple times,
you might be right. Certainly reassigning built-in names
is a bad practice :)
--
Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE EMPHATIC I!
(random hero from isometric.spaceninja.com)