[Zope] Strange String comparison problem (python script)

Paul Winkler pw_lists@slinkp.com
Thu, 29 Aug 2002 11:07:43 -0700


On Thu, Aug 29, 2002 at 12:53:50PM -0500, Mark McEahern wrote:
> > if user == context.getId():
> 
> Have you tried:
> 
>   if str(user) == str(context.getId()):
> 
> I'm just guessing.

... but I think you guess right, because user is actually
a user object, not a string. When printed, it is  
implicitly converted to a string. But comparisons
won't do implicit conversions. So you need to do it
explicitly, using str().

--

Paul Winkler
"Welcome to Muppet Labs, where the future is made - today!"