Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!news.wiretrip.org!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'instance,': 0.05; '>>>>': 0.09; 'pm,': 0.11; '>>>': 0.12; 'wrote:': 0.14; '"x"': 0.16; 'subject:function': 0.16; 'argument': 0.16; 'invalid': 0.16; 'traceback': 0.16; '(most': 0.16; 'keyword': 0.19; 'header:In- Reply-To:1': 0.22; 'convert': 0.22; 'tells': 0.22; 'last):': 0.23; 'referring': 0.23; 'value.': 0.25; 'url:mailman': 0.27; 'function': 0.27; 'message-id:@mail.gmail.com': 0.28; 'testing': 0.28; 'fri,': 0.29; "python's": 0.29; 'context,': 0.31; 'typeerror:': 0.31; 'to:addr:python-list': 0.32; 'url:listinfo': 0.33; "isn't": 0.34; 'using': 0.34; 'file': 0.35; '"",': 0.35; 'constant': 0.35; 'function.': 0.35; 'doing': 0.36; 'assigned': 0.37; 'url:python': 0.37; 'exactly': 0.37; 'apr': 0.38; 'received:google.com': 0.38; 'but': 0.38; 'url:org': 0.38; 'to.': 0.39; 'to:addr:python.org': 0.39; '2011': 0.62; 'truth': 0.65; 'candide': 0.84; 'received:129': 0.84 MIME-Version: 1.0 In-Reply-To: <4d9f374b$0$12803$426a34cc@news.free.fr> References: <4d9f374b$0$12803$426a34cc@news.free.fr> Date: Fri, 8 Apr 2011 12:41:50 -0400 Subject: Re: Argument of the bool function From: Benjamin Kaplan To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-Junkmail-Status: score=10/49, host=mpv2.tis.cwru.edu X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A020205.4D9F3ACF.00CD,ss=1,fgs=0, ip=74.125.82.182, so=2010-02-10 23:06:36, dmn=2009-09-10 00:05:08, mode=single engine X-Junkmail-IWF: false X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 48 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1302280920 news.xs4all.nl 65870 [::ffff:82.94.164.166]:56478 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2857 On Fri, Apr 8, 2011 at 12:26 PM, candide wrote: > About the standard function bool(), Python's official documentation tells us > the following : > > bool([x]) > Convert a value to a Boolean, using the standard truth testing procedure. > > > In this context, what exactly a "value" is referring to ? > > > For instance, > > >>>> x=42 >>>> bool(x=5) > True >>>> > > > but _expression_ : > > x=42 > > > has no value. > That's because bool(x=5) isn't doing what you think. >>> bool(y=5) Traceback (most recent call last): File "", line 1, in TypeError: 'y' is an invalid keyword argument for this function bool(x=5) is just passing the value 5 as the argument "x" to the function. "value" means just what you'd think- any constant or any value that's been assigned to. > > > > > > -- > http://mail.python.org/mailman/listinfo/python-list >