Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Stephen Hansen Newsgroups: comp.lang.python Subject: Re: Python Madlibs.py code and error message Date: Thu, 28 Apr 2016 00:08:50 -0700 Lines: 29 Message-ID: References: <3cff626c-28a2-499c-9877-de2df4d459d0@googlegroups.com> <6c0d96c5-c7f5-4659-a2e9-20f8d202d701@googlegroups.com> <1461820617.3238425.591942249.1484DAC3@webmail.messagingengine.com> <85fuu6jo1o.fsf@benfinney.id.au> <1461826246.3257796.591992793.54C5CC58@webmail.messagingengine.com> <85bn4ujk7p.fsf@benfinney.id.au> <1461827330.3261212.591998673.4D215991@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de Lj9bTIPAjJpCneKppEu0sgY0NXduonFH8qGzJYgIlk1A== 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; 'string.': 0.04; 'subject:Python': 0.05; 'subject:code': 0.07; 'confuse': 0.09; 'received:internal': 0.09; 'python': 0.10; 'subject:error': 0.11; 'wed,': 0.15; 'better:': 0.16; 'compatible.': 0.16; 'formatting.': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:10.202.2.44': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:compute4.internal': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; '(not': 0.20; '3.x': 0.22; 'skip:% 10': 0.22; 'stephen': 0.22; 'examples': 0.24; 'header:In-Reply-To:1': 0.24; 'parameters': 0.27; 'values': 0.28; 'fine': 0.28; 'helpful.': 0.29; 'code': 0.30; 'url:python': 0.33; 'except': 0.34; 'running': 0.34; "isn't": 0.35; 'url:org': 0.36; 'url:library': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'received:66': 0.38; 'version': 0.38; 'format': 0.39; 'to:addr:python.org': 0.40; 'url:3': 0.60; 'header:Message-Id:1': 0.61; 'show': 0.62; 'skip:n 10': 0.62; 'to,': 0.63; 'series': 0.65; 'skip:\xe2 10': 0.70; '10:32': 0.84; 'confusion.': 0.84; 'url:string': 0.84; 'wishing': 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=8KRQBRXmTP45/qIVG2umfP0r4xQ=; b=j4DRUo Ak0rtr1egVjDN4Mg90wm6VBtxQnGVEaApsM74ZezCaG4EfYOPUQYfEMz0GGjmyZa ZS4mWL0/UbYDiPN/nLAud4g5W42B6Z7p1+4sMYyXtF77THr9TEQZH62qgHYCwdR2 u0xHFWMVBHbFE/KHXRdhmcMmRebDQ9Zh/dVJk= 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=8KRQBRXmTP45/qI VG2umfP0r4xQ=; b=XHGHw+PBKTTYCawpNy2AhD1XH4OSaLRW4i5bidadWd1IVbB awlO0JsbnQrUdHXvnXvHrdC9/tbyTFJb5yZnQJMDZjAHv0YK2X5Q1/4e7XqvLs5Y f78RPcOJlmdgGTKgJgfN1UDJPzP4LoZkOpuHM9UPsMQ4KHWgGs1EgkIlOTZE= X-Sasl-Enc: XZQomO9Mg0ZdSZYKwVO+Bwxlp1yOWGKlFaCBLxhtl6bP 1461827330 X-Mailer: MessagingEngine.com Webmail Interface - ajax-f1265324 In-Reply-To: <85bn4ujk7p.fsf@benfinney.id.au> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 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: <1461827330.3261212.591998673.4D215991@webmail.messagingengine.com> X-Mailman-Original-References: <3cff626c-28a2-499c-9877-de2df4d459d0@googlegroups.com> <6c0d96c5-c7f5-4659-a2e9-20f8d202d701@googlegroups.com> <1461820617.3238425.591942249.1484DAC3@webmail.messagingengine.com> <85fuu6jo1o.fsf@benfinney.id.au> <1461826246.3257796.591992793.54C5CC58@webmail.messagingengine.com> <85bn4ujk7p.fsf@benfinney.id.au> Xref: csiph.com comp.lang.python:107766 On Wed, Apr 27, 2016, at 11:55 PM, Ben Finney wrote: > Stephen Hansen writes: >=20 > > On Wed, Apr 27, 2016, at 10:32 PM, Ben Finney wrote: > > > Better: when you have many semantically-different values, use named > > > (not positional) parameters in the format string. [=E2=80=A6] > > >=20 > > > > > > > Except the poster is not using Python 3, so all of this is for naught.= =20 >=20 > Everything I described above works fine in Python 2. Any still-supported > version has =E2=80=98str.format=E2=80=99. This response is completely unhelpful. The OP is using Python 2, and using %-formatting, and so you give a series of examples of using str.format, to, what? Confuse matters? You can show using non-positional values using the format the user is using -- "%(name)s" formatting. You even reference a link to the Python 3 docs, even though the OP is running code which isn't 3.x compatible. Confusion. Wishing Python2 away isn't helpful.=20 --=20 Stephen Hansen m e @ i x o k a i . i o