Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.03; 'explicitly': 0.04; 'ignored': 0.05; 'assign': 0.07; 'correct.': 0.07; 'executed': 0.07; 'host,': 0.07; 'parsing': 0.07; 'variable,': 0.07; 'python': 0.09; 'fails.': 0.09; 'worse': 0.09; 'language': 0.14; 'expression,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'parse,': 0.16; 'statement.': 0.16; 'wrote:': 0.17; 'shell': 0.18; 'code,': 0.18; 'feb': 0.19; 'equivalent': 0.20; 'question.': 0.20; 'error.': 0.21; 'meant': 0.21; 'explicit': 0.22; 'parse': 0.22; "python's": 0.23; 'so.': 0.24; 'host': 0.24; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'executing': 0.27; 'execution': 0.27; 'mix': 0.27; 'reaches': 0.27; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'chris': 0.28; "d'aprano": 0.29; 'host.': 0.29; 'implicitly': 0.29; 'steven': 0.29; 'handled': 0.29; 'no,': 0.29; 'fri,': 0.30; 'function': 0.30; 'expect': 0.31; 'code': 0.31; 'could': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; 'anything': 0.36; 'execute': 0.37; 'does': 0.37; 'being': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'things': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'back': 0.62; 'is.': 0.62; 'subject:...': 0.63; 'results': 0.65; '2013': 0.84; 'execution.': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=VqrinWRxNhLJr/OX/xGS/3YKf2COtFtsCtMrIYVcEAE=; b=KxkUkPuGqXBASGqek8KRXAyL81HM18yNdd3Hck6LUIUwtIAGo+cMQZfLKKsfqPWhZW jmN5sWJDftiIPrv6dgXTbN/aWGd2CL1mxhwioLqdA9gMJwXOIXGqEz4gpzMVE0TWZE0z l/+in+GM641IXtkNAxNhHz9PK6CL0NPdzIgfHBXyTD94qVDceqhtzAIPMeZk84xT/AnM bKOqfqZMTaE2iEIW7OjysMuT3j/6Y0yOsiD+JdpHZP/uHoJiXd0Rx7nrCcKWfftIpaKF ohId+hl/4Mk2JUO1Yy1cnsnghr5pHUQG5avO8nae7vef+57ZtmpS/fGjdUpukNh4O3Dd LwSQ== MIME-Version: 1.0 X-Received: by 10.220.156.10 with SMTP id u10mr5270686vcw.28.1360306479180; Thu, 07 Feb 2013 22:54:39 -0800 (PST) In-Reply-To: <51142f5e$0$6512$c3e8da3$5496439d@news.astraweb.com> References: <207d17ce-4bc7-487c-acde-6a7b9f66002b@googlegroups.com> <5111b826$0$29969$c3e8da3$5496439d@news.astraweb.com> <5112eb4a$0$29965$c3e8da3$5496439d@news.astraweb.com> <51134e9f$0$21812$c3e8da3$76491128@news.astraweb.com> <51142f5e$0$6512$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 8 Feb 2013 17:54:39 +1100 Subject: Re: Opinion on best practice... From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360306481 news.xs4all.nl 6860 [2001:888:2000:d::a6]:38469 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38425 On Fri, Feb 8, 2013 at 9:49 AM, Steven D'Aprano wrote: > Chris Angelico wrote: > Yes, that is correct. Because now you are executing code, which could do > something, and some things are dangerous. But Python will never execute > code unless you explicitly tell it to. There's no concept in Python of > falling back onto code execution if parsing fails. A bare expression IS explicitly calling for code execution. That's simply the way the language is. If you don't want the return value to be sent to the host, you either assign it to a variable, or use CALL (if it's a function call). > I note that you ignored my question. If REXX reaches code that fails to > parse, does it send it to the shell to be executed by default? If the > answer was No, I expect you would have said so. Anything that doesn't parse is a syntax error. It's only expression results that go to the host (shell). > Good lord, that's even worse than I feared. So it's not just unparsable > non-REXX code that is implicitly sent to the shell, but the equivalent to > Python's NameErrors. And you can implicitly mix calls to the shell and REXX > function calls in the same line. If it was meant to be a name, then it'll be in an expression, which - see above - is an explicit request for it to be handled by the host. The only thing that'll trip you up there is misspelling a language keyword: iff blah blah blah blah which will be sent to the host instead of being an 'IF' statement. ChrisA