[Python-Dev] Multiple expression eval in compound if statement?

Michael Chermside mcherm at mcherm.com
Mon Jun 13 13:48:31 CEST 2005


Skip writes:
> Even an apparently simple variable can have side effects [...] Consider
> the builtin help object.  Type it at the prompt with no parens.

I tried. As far as I can tell, the result (in the interactive interpreter)
is the same as with any other object except None: the _ variable gets set,
the interpreter prints out the __str__ of the object, sets the _ variable,
and prints a new '>>>' prompt. It happens that the __str__ of the help
object is:
'Type help() for interactive help, or help(object for help about object.'

... but if there's some side effect going on here, I don't see it. What
am I missing?

-- Michael Chermside


More information about the Python-Dev mailing list