Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7121

Re: new string formatting with local variables

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'arguments.': 0.09; 'subject:string': 0.09; 'pm,': 0.10; 'wrote:': 0.14; 'finney': 0.16; 'subject:formatting': 0.16; 'unpack': 0.16; 'argument': 0.16; 'cc:addr:python-list': 0.17; 'mon,': 0.17; 'keyword': 0.19; 'mapping': 0.19; 'header:In-Reply-To:1': 0.21; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; 'received:209.85.161.46': 0.23; 'received:mail-fx0-f46.google.com': 0.23; 'received:209.85.161': 0.26; 'says': 0.27; 'message-id:@mail.gmail.com': 0.28; 'cc:addr:python.org': 0.30; "isn't": 0.33; 'using': 0.35; 'reference': 0.35; 'subject:new': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.37; 'subject:: ': 0.38; 'received:209': 0.39; 'subject:with': 0.39; 'why?': 0.73; 'subject:local': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=xb44AY1sgF+n3ok6bk8di5wyFMc9UcrvR59stjejD1o=; b=W+V12tjH7qsLAZeoOm7V4+oUztHy9/EqG3Z6taBK+OnYPSHypXz/9oBDRIizMaQDgl 7q82nF83mpNx/VvKSYHj+5Z4F71V214PYUBqVDb9nUW+ezCqYSeJQwRYaTd/fMPgXKCT KbaMyB9yV4ksCjJA1nRcXTxi8r84+WaAzHHgA=
DomainKey-Signature a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=iTnmyRwjAKgN8dh9YkBHyq4EVLRhXFtlwrtl1LEikO40/1jc5GQ1lpi8rw2dIjRN1J Zk42lpPXpyI12LQVitMH3nqBzgbu6EYN6mXv10ijCJ/neiaEAtBP/YouaFAeGYs8Q/j9 94n8vK9Q6f3ZIrRFmBKh+CpU9DtnFDb7JZ1Bs=
MIME-Version 1.0
In-Reply-To <87zklu1ox6.fsf@benfinney.id.au>
References <BANLkTi=VUwFDv5otq=7CMngbWzHy3Fo50A@mail.gmail.com> <mailman.2491.1307377282.9059.python-list@python.org> <87zklu1ox6.fsf@benfinney.id.au>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Mon, 6 Jun 2011 18:31:36 -0600
Subject Re: new string formatting with local variables
To Ben Finney <ben+python@benfinney.id.au>
Content-Type text/plain; charset=ISO-8859-1
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2511.1307406733.9059.python-list@python.org> (permalink)
Lines 8
NNTP-Posting-Host 82.94.164.166
X-Trace 1307406733 news.xs4all.nl 49176 [::ffff:82.94.164.166]:58999
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:7121

Show key headers only | View raw


On Mon, Jun 6, 2011 at 6:11 PM, Ben Finney <ben+python@benfinney.id.au> wrote:
>> You must use prefix-** in the call to unpack the mapping as keyword
>> arguments. Note that using locals() like this isn't best-practice.
>
> Who says so, and do you find their argument convincing? Do you have a
> reference for that so we can see why?

http://stackoverflow.com/questions/1550479/python-is-using-vars-locals-a-good-practice

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: new string formatting with local variables Chris Rebert <clp2@rebertia.com> - 2011-06-06 09:21 -0700
  Re: new string formatting with local variables Ben Finney <ben+python@benfinney.id.au> - 2011-06-07 10:11 +1000
    Re: new string formatting with local variables Ian Kelly <ian.g.kelly@gmail.com> - 2011-06-06 18:31 -0600
    Re: new string formatting with local variables Ian Kelly <ian.g.kelly@gmail.com> - 2011-06-06 18:38 -0600
    Re: new string formatting with local variables Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-07 03:57 +0000
      Re: new string formatting with local variables Ben Finney <ben+python@benfinney.id.au> - 2011-06-07 17:47 +1000

csiph-web