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


Groups > comp.lang.python > #67116

Re: exec and locals

Path csiph.com!usenet.pasdenom.info!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'string': 0.09; 'exec': 0.09; 'feature.': 0.09; 'sure,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'guys,': 0.16; 'runtime.': 0.16; ':-)': 0.16; 'language': 0.16; 'wrote:': 0.18; 'looked': 0.18; 'thu,': 0.19; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'compilation': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'second': 0.26; 'header:In-Reply- To:1': 0.27; 'feature': 0.29; "doesn't": 0.30; 'important.': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; "d'aprano": 0.31; 'steven': 0.31; "we're": 0.32; 'but': 0.35; 'received:google.com': 0.35; 'programming,': 0.36; 'should': 0.36; 'pm,': 0.38; 'dangerous': 0.60; 'day': 0.76; '"look': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=KUAZWr5BKJDF4/ubj05QRFgK2zG+wSKQy+fSe95qZd4=; b=sRd5DokW0UE28c0mNkpWjN+nNPpurOuUnu+9IFWIw8c04CGfY6i8sNDm5fmIW3j685 4SkJPZga+zgs5vRv07/UPmUHjeiTJ9GozGE2fxtLeOSbPU4ZAk15SfUXLEoTfdQnb5uQ EKmF4QGOiAEOl12gdnJhgDtGtm85TrZ3dwGZO0zOmMsSY+YLwQ60KcDW1HevO2Z5vREQ CrSbmRWeiplce2f63UfWEk2Gxd7/9BRE8kpow1t3II6qfhaVg3fFUF1k44C6uGIWEgHY K+nQEbTUnRWU89LDahxehwG/JT5wlBCEGGYSTyjPKvFmPtQTkSwrBYviU4l0O9xtbizT SQkg==
MIME-Version 1.0
X-Received by 10.68.201.10 with SMTP id jw10mr11243245pbc.25.1393477518446; Wed, 26 Feb 2014 21:05:18 -0800 (PST)
In-Reply-To <530ec365$0$11113$c3e8da3@news.astraweb.com>
References <530de8ed$0$29985$c3e8da3$5496439d@news.astraweb.com> <mailman.7393.1393422407.18130.python-list@python.org> <530e8608$0$11113$c3e8da3@news.astraweb.com> <mailman.7403.1393474578.18130.python-list@python.org> <530ec365$0$11113$c3e8da3@news.astraweb.com>
Date Thu, 27 Feb 2014 16:05:18 +1100
Subject Re: exec and locals
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.7405.1393477521.18130.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1393477521 news.xs4all.nl 2902 [2001:888:2000:d::a6]:57466
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:67116

Show key headers only | View raw


On Thu, Feb 27, 2014 at 3:47 PM, Steven D'Aprano <steve@pearwood.info> wrote:
> Guys, I know that exec is kinda dangerous and newbies should be
> discouraged from throwing every string they see at it, but this isn't my
> second day Python programming, and it's not an accident that Python
> supports the dynamic compilation and execution of source code at runtime.
> It's a deliberate language feature. We're allowed to use it :-)

Code smell means "look at this". It doesn't mean "don't use this
feature ever". :) Steven's looked into this thoroughly, I'm sure, and
exec is important.

ChrisA

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


Thread

exec and locals Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-26 13:15 +0000
  Re: exec and locals Chris Angelico <rosuav@gmail.com> - 2014-02-27 00:40 +1100
  Re: exec and locals Peter Otten <__peter__@web.de> - 2014-02-26 14:46 +0100
    Re: exec and locals Steven D'Aprano <steve@pearwood.info> - 2014-02-27 00:25 +0000
      Re: exec and locals Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-02-27 16:34 +1300
        Re: exec and locals Steven D'Aprano <steve@pearwood.info> - 2014-02-27 04:39 +0000
          Re: exec and locals Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-02-28 00:29 +1300
            Re: exec and locals Chris Angelico <rosuav@gmail.com> - 2014-02-27 22:41 +1100
            Re: exec and locals Steven D'Aprano <steve@pearwood.info> - 2014-02-28 01:49 +0000
      Re: exec and locals Dan Sommers <dan@tombstonezero.net> - 2014-02-27 03:47 +0000
      Re: exec and locals Dave Angel <davea@davea.name> - 2014-02-26 23:20 -0500
        Re: exec and locals Steven D'Aprano <steve@pearwood.info> - 2014-02-27 04:47 +0000
          Re: exec and locals Chris Angelico <rosuav@gmail.com> - 2014-02-27 16:05 +1100
  Re: exec and locals Peter Otten <__peter__@web.de> - 2014-02-26 14:55 +0100
  Re: exec and locals Alister <alister.ware@ntlworld.com> - 2014-02-26 14:00 +0000
    Re: exec and locals Steven D'Aprano <steve@pearwood.info> - 2014-02-27 00:31 +0000
      Re: exec and locals Alister <alister.ware@ntlworld.com> - 2014-02-27 09:59 +0000

csiph-web