Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Stephen Hansen Newsgroups: comp.lang.python Subject: Re: Most probably a stupid question, but I still want to ask Date: Sun, 10 Apr 2016 21:46:58 -0700 Lines: 10 Message-ID: References: <570b02db$0$1605$c3e8da3$5496439d@news.astraweb.com> <570b2000$0$22142$c3e8da3$5496439d@news.astraweb.com> <1460350018.3507765.574780001.5531F1C0@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de jS/4fTC+nopramH+9In5DwtWbiZnSDlTwmWpC9334mlA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:question': 0.08; 'received:internal': 0.09; 'result)': 0.09; 'subject:still': 0.09; 'message-id:@webmail.messagingengine.com': 0.16; 'multiples': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:66.111.4.27': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:out3-smtp.messagingengine.com': 0.16; 'received:psf.io': 0.16; 'tuple,': 0.16; 'wrote:': 0.16; 'string': 0.17; 'header:In- Reply-To:1': 0.24; 'but': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'doing': 0.38; 'received:66': 0.38; 'to:addr:python.org': 0.40; 'still': 0.40; "you'll": 0.61; 'avoid': 0.61; 'header:Message-Id:1': 0.61; 'safe': 0.63; 'subject:want': 0.93 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=ixokai.io; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=Td2HEFpZ0/jDYZqfrjil2ee0VQM=; b=MOEidi kgwlhKDpixKBTAuVe9EhsENOi9A+CKEEeoTzNByAQMQCnqEw6TY4z+o/R1z1kMYc WAWwe0WvAmRptR50bqkJcMdcCy55xtoN4DvtVMap3Lv7ze0GHQNYLsFIARLHgtzE tUldhzj5hAwyHFOT9ifVCOC31iniUz4QyWA2k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Td2HEFpZ0/jDYZq frjil2ee0VQM=; b=fVC9md0q4sDCRD7hv7tJ0OCx4muPDpGI/NypYU2YJe4lkdY lSF34pJFALA+W2Xxk5nCrwsdNKAqUtpRG/9adKmWN896SDmekyCelO1lf4Rd8ywB i8jY9rrtqwO09MjVLUPcRCmxPHghiX6apvzJbXDz2xf7ytxgXIP+3jZWz/pw= X-Sasl-Enc: y+XDsNT6LFFNVuGo2TCi9LcIX61MqQLPbfKg77lxYAbP 1460350018 X-Mailer: MessagingEngine.com Webmail Interface - ajax-82e6ff7b In-Reply-To: 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: , X-Mailman-Original-Message-ID: <1460350018.3507765.574780001.5531F1C0@webmail.messagingengine.com> X-Mailman-Original-References: <570b02db$0$1605$c3e8da3$5496439d@news.astraweb.com> <570b2000$0$22142$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:106853 On Sun, Apr 10, 2016, at 09:03 PM, Fillmore wrote: > and the (almost always to be avoided) use of eval() FWIW, there's ast.literal_eval which is safe and there's no reason to avoid it. You'll still have to deal with the fact that a single string on a line will return a string while multiples will return a tuple, but how you're doing that (checking the type of the result) is fine. --Stephen m e @ i x o k a i . i o