Argument of the bool function

Ian Kelly ian.g.kelly at gmail.com
Fri Apr 8 12:43:22 EDT 2011


On Fri, Apr 8, 2011 at 10:26 AM, candide <candide at free.invalid> wrote:
>>>> x=42
>>>> bool(x=5)
> True
>>>>
>
>
> but _expression_ :
>
> x=42
>
>
> has no value.

"x=42" is an assignment statement, not an expression.
In "bool(x=5)", "x=5" is also not an expression.  It's passing the
expression "5" in as the parameter x, using a keyword argument.



More information about the Python-list mailing list