Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.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.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '21,': 0.07; 'subject:Question': 0.07; 'subject:skip:a 10': 0.09; 'suggest': 0.14; 'evaluates': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'personally,': 0.16; 'wrote:': 0.18; 'convenient': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'strongly': 0.30; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'faster,': 0.31; 'steven': 0.31; 'probably': 0.32; 'but': 0.35; 'received:google.com': 0.35; 'list': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'worth': 0.66; 'hand.': 0.84; '2013': 0.98 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=ygfICFTcGd4FwenyNX18sHvHIp4jTzgYe9gp9pZgDpg=; b=fpXufj0I2uFWLrI57c+R+gXKIhD0k/Igru+BNPy+4Q3G2F82fbo8s6oq7EyQC9VLej RQVGnrcLUm/Gcu6XDfOlGu1vguXy7MHqef16QwJCm1ZvqwAgjDVTIUSMKv3R2A05skaP 9F5RPkI5G6DDSvwoDOTtR0vWuCrN/JY6Imv4Y0MOOlg3ylr7YU3EpXw8mZdn6UbU1v8t 7dFts+CgnEMm83aeupO5kQUHMH5st+MvubXiHRm+beKS0mKtN/FPFaAdNiOhwQBM78x8 /GD8QUAhdC3jR4/Ewc/CLx+yb9GbgU1jCn7+btnptREguyBQoxFt4e+Tfs1u/u2eJmS+ MCNA== MIME-Version: 1.0 X-Received: by 10.52.65.238 with SMTP id a14mr13061649vdt.24.1369066999115; Mon, 20 May 2013 09:23:19 -0700 (PDT) In-Reply-To: <519a4b6a$0$29997$c3e8da3$5496439d@news.astraweb.com> References: <519a4b6a$0$29997$c3e8da3$5496439d@news.astraweb.com> Date: Tue, 21 May 2013 02:23:19 +1000 Subject: Re: Question about ast.literal_eval 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: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369067002 news.xs4all.nl 15942 [2001:888:2000:d::a6]:44953 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45624 On Tue, May 21, 2013 at 2:12 AM, Steven D'Aprano wrote: > Personally, I would strongly suggest writing your own mini- > evaluator that walks the list and evaluates it by hand. It isn't as > convenient as just calling eval, but *definitely* safer. Probably faster, too, for what it's worth - eval is pretty expensive. ChrisA