Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.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.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'int': 0.05; 'remind': 0.05; '>>>>': 0.09; 'bool': 0.09; 'dev': 0.09; 'pm,': 0.11; 'programmer': 0.11; 'wrote:': 0.14; 'starts': 0.15; 'better:': 0.16; 'subject:() ': 0.16; 'subject:function': 0.16; 'awesome': 0.19; 'interpret': 0.19; 'keyword': 0.19; 'language': 0.20; 'programming': 0.20; 'header:In-Reply-To:1': 0.22; 'mon,': 0.22; 'subject:code': 0.23; 'define': 0.26; 'chris': 0.27; 'message- id:@mail.gmail.com': 0.28; 'to:addr:python-list': 0.32; 'another': 0.32; 'idea': 0.32; 'expression': 0.33; 'someone': 0.33; 'print': 0.35; '"",': 0.35; 'assignment': 0.35; 'think': 0.36; 'some': 0.37; 'received:209.85': 0.37; 'either': 0.37; 'apr': 0.38; 'received:google.com': 0.38; 'skip:" 20': 0.38; 'completely': 0.38; 'lets': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.39; "it's": 0.40; 'header:Received:5': 0.40; 'allows': 0.40; 'might': 0.40; '2011': 0.62; 'taught': 0.65; 'day': 0.66; 'yourself': 0.66; 'anything.': 0.72; 'difference.': 0.84; 'python2.7': 0.84; 'received:209.85.210.174': 0.84; 'received :mail-iy0-f174.google.com': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=ZNStx5gWz5vmIc4f7SmzH+Eu4FnA4bDuIqVxeX0ebns=; b=m7sbf/trtgpiZ3JGNIV+dgOvVXBe5N2S7uOoHZXsLE1adJSYzvNaa4TRzsxi8D7CnV UXrbVhXwsLGJD8O0D40fI6lbYpe97b6/JZ30k/itlT9adEUP3KlT4iq549uaJLX8JXtA 41a54VYHCfoBlANDr8T19BSkr2vUSiT0jwz3s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=XxIZFGODR3dnvBYOoDkHJSnPRh5keKsDj975wMPT0R4jP3b0XAMi5UDDx016HJuk6S dudf7REzPeX5V+DeLPA1RNUQOPUNFEcZxfFFeGwZFb91sKgCQWB8T+5yBXbG1K7M+BF4 3M8P2i7oqpUTU4u4XUyyv39z6qU7DbxQX5DiA= MIME-Version: 1.0 In-Reply-To: References: <4da9fb0b$0$13696$426a74cc@news.free.fr> <87k4etho6e.fsf@benfinney.id.au> <4DAB97FD.20103@ieee.org> Date: Mon, 18 Apr 2011 14:53:19 +1000 Subject: Re: Equivalent code to the bool() built-in function From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 34 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1303102402 news.xs4all.nl 41114 [::ffff:82.94.164.166]:40597 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3456 On Mon, Apr 18, 2011 at 2:40 PM, Ned Deily wrote: > Chris Angelico: >> =A0Dave Angel: >> >>>> bool =3D int >> Any language that allows you to do this is either awesome or >> terrifying. Come to think of it, there's not a lot of difference. > > Even better: > $ python2.7 -c 'False =3D True; print False' > True http://bofh.ch/bofh/bofh13.html > Alas: > $ python3 -c 'False =3D True; print(False)' > =A0File "", line 1 > SyntaxError: assignment to keyword Someone in Python3 dev thinks it's a bad idea to shoot yourself in the foot= . Remind me some day to finish work on my "ultimate programming language", which starts out with a clean slate and lets the programmer define his own operators and everything. Pro: The expression evaluator can be taught to interpret Dungeons & Dragons notation - 2d6 means "random(1,6)+random(1,6)". Con: The same expression might mean something completely different in another program. Pro: You can do anything. Con: You can do anything. ChrisA