Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'interpreter.': 0.07; 'hiding': 0.09; 'subject:question': 0.10; 'python': 0.11; 'jan': 0.12; '(without': 0.16; '23,': 0.16; 'arbitrarily': 0.16; 'bullet': 0.16; 'dangerous,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'presume': 0.16; 'reedy': 0.16; 'weird.': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'thu,': 0.19; '>>>': 0.22; 'input': 0.22; 'switch': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'label': 0.30; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'option': 0.32; 'text': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'building': 0.35; 'really': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'dangerous': 0.60; 'regexp': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=UoapXpnwh1+veJ8Ki6fKLszuH1XYOMfe42v/J9gUROo=; b=OJ0YuFqRytmQymNiZs8QvSyMUuz7nllLZ6bljuckB9brg80BmY5UZR4QSViI1qTui9 /3zQPagWQJEyqTBC9lm8dEwXFrPX/Y5BHEQD+ranzoZon7ukLb2ndWF25XVzzGwbreTP MuobZ/NtvoREplMMtMub7P3soEo9EF0L94DCJpgIfBOUWiKgUCjHoaio86hRWDKnmkQN waDmXL+/EvuR0qfozu09CiwtnFtHs1lW10II2mTE3BmAxw1zjnnbLWhYdyVQdZO0uIN2 MXzbgXucJbOwtf3esyEXPwaGvzzUIgLYo4JQkTofWER62i0CmA6FFuIpnxp2hTLPFAba 84bQ== MIME-Version: 1.0 X-Received: by 10.220.111.133 with SMTP id s5mr4365083vcp.63.1369293620003; Thu, 23 May 2013 00:20:20 -0700 (PDT) In-Reply-To: References: <534d7800-14c1-430b-85fb-dd703c2acc4d@googlegroups.com> <519d9f71$0$1591$c3e8da3$76491128@news.astraweb.com> Date: Thu, 23 May 2013 17:20:19 +1000 Subject: Re: Newbie question about evaluating raw_input() responses 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369294009 news.xs4all.nl 15933 [2001:888:2000:d::a6]:57538 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45782 On Thu, May 23, 2013 at 5:11 PM, Terry Jan Reedy wrote: > On 5/23/2013 12:47 AM, Steven D'Aprano wrote: >> >> On Wed, 22 May 2013 22:31:04 +0000, Alister wrote: >> >>> Please write out 1000 time (without using any form of loop) >>> >>> "NEVER use input in python <3.0 it is EVIL"* > > >> But all joking aside, eval is dangerous, yes, but it is not "evil". > > > He put that label on *input*, not eval -- I presume for hiding dangerous > eval. Aside: Why was PHP's /e regexp option ever implemented? I can understand evalling inputted text - that's how you write an interactive interpreter. But why would you arbitrarily eval the result of a regexp replacement? That seems... really weird. Like building a gun with a "Reverse" switch that fires the bullet down the butt instead of the barrel. ChrisA