Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Matt Wheeler Newsgroups: comp.lang.python Subject: Re: newbie question Date: Thu, 24 Mar 2016 13:22:13 +0000 Lines: 16 Message-ID: References: <56f3c3eb$0$4546$426a74cc@news.free.fr> <56F3CB1E.2000606@mail.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 1V0sMqU7cXOBST6NryLHGgCuisdJ20Od64khTqlyS9GQ== 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; 'subject:question': 0.08; '(1,': 0.09; 'ast': 0.09; 'thu,': 0.15; '2016': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'to:name:python list': 0.16; 'wrote:on': 0.16; 'wrote:': 0.16; '>': 0.18; 'suppose': 0.22; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'module': 0.25; 'message-id:@mail.gmail.com': 0.27; 'gets': 0.35; 'received:google.com': 0.35; 'received:209.85': 0.36; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'skip:& 10': 0.37; 'received:209': 0.38; 'to:addr:python.org': 0.40; 'mar': 0.65; 'from:addr:m': 0.84; 'safety.': 0.84; 'shares': 0.93 X-Virus-Scanned: Debian amavisd-new at membrane.funkyhat.net X-Gm-Message-State: AD7BkJKBMaWMZV4HCZOJqOkz3l/Y7kfziAb+fvWJ8QrEbL4t+1p09RfAXFGei9v9iXU+xlhRQMxvaxfxzTKzqQ== X-Received: by 10.112.131.2 with SMTP id oi2mr3400026lbb.67.1458825743519; Thu, 24 Mar 2016 06:22:23 -0700 (PDT) In-Reply-To: <56F3CB1E.2000606@mail.de> X-Gmail-Original-Message-ID: X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105607 On Thu, 24 Mar 2016 11:10 Sven R. Kunze, wrote: > On 24.03.2016 11:57, Matt Wheeler wrote: > >>>> import ast > >>>> s = "(1, 2, 3, 4)" > >>>> t = ast.literal_eval(s) > >>>> t > > (1, 2, 3, 4) > > I suppose that's the better solution in terms of safety. > It has the added advantage that the enquirer gets to import a module that shares their name ;) >