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


Groups > comp.lang.python > #32487

Re: exec with partial globals

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.065
X-Spam-Evidence '*H*': 0.87; '*S*': 0.00; 'exec': 0.07; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'oct': 0.16; 'wrote:': 0.17; 'input': 0.18; 'bit': 0.21; 'received:209.85.214.174': 0.21; 'pass': 0.25; 'header:In-Reply- To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'objects': 0.29; 'this.': 0.29; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'subject:with': 0.36; 'should': 0.36; 'possible': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'build': 0.39; 'header:Received:5': 0.40; '30,': 0.62; '(source)': 0.84; 'spreadsheet': 0.84
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:to :content-type; bh=LhT8py802rtQ00GF0nsJQjKIt9+s3n9GyfGD8qYHVYg=; b=1BRxPOacKHnv20VHxlHw3epsQtimwCSQnC5ujAr1+ktfAm9DGQmAgeOxNgQawzBQUd FpbqBQ/lGY55rxQFvKSiNE0jLbS3VGlm5SEwmd6VwKDyzo8EdOC+SFUouDC7uIR1yzIS aJDdd30id2nmvPHWHwitCKPLwC6ba6MCK1GAVRw7EPu+PRYhW1ZTpQmrjoQNTv+IwMg1 MwVEAAolIhw29pG2Sdy3eAtbNeCynYgvn2uPyTp1UswE38jMemJGqVpPc7uCb6XWjyfW q7ZmTgZbU6uCQ2jfnl/5m1AnWfTPCOx/ub8moPZvrbZN+VY9aeyZkyX5hss6YA7C3P6I R2xQ==
MIME-Version 1.0
In-Reply-To <afa15qFnmkaU2@mid.dfncis.de>
References <af9tq3FnmkaU1@mid.dfncis.de> <mailman.3087.1351600438.27098.python-list@python.org> <afa15qFnmkaU2@mid.dfncis.de>
Date Wed, 31 Oct 2012 00:18:57 +1100
Subject Re: exec with partial globals
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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 <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.3088.1351603139.27098.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1351603139 news.xs4all.nl 6982 [2001:888:2000:d::a6]:59394
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:32487

Show key headers only | View raw


On Tue, Oct 30, 2012 at 11:57 PM, Helmut Jarausch
<jarausch@igpm.rwth-aachen.de> wrote:
> Given spreadsheet  S (Source) and D (Destination) as objects (wrapping a
> dictionary) a possible (legal) input would be
>
> D.price= D.price-S.discount
>
> No other fields of 'D' should be modifiable.

That's a bit harder. What you're describing, using exec with specific
globals, would not be able to do this. You'd need to build a proxy
object that decides whether or not to pass on the change.

ChrisA

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


Thread

exec with partial globals Helmut Jarausch <jarausch@igpm.rwth-aachen.de> - 2012-10-30 12:00 +0000
  Re: exec with partial globals Chris Angelico <rosuav@gmail.com> - 2012-10-30 23:28 +1100
  Re: exec with partial globals Dave Angel <d@davea.name> - 2012-10-30 08:33 -0400
    Re: exec with partial globals Helmut Jarausch <jarausch@igpm.rwth-aachen.de> - 2012-10-30 12:57 +0000
      Re: exec with partial globals Chris Angelico <rosuav@gmail.com> - 2012-10-31 00:18 +1100
      Re: exec with partial globals Dave Angel <d@davea.name> - 2012-10-30 09:39 -0400

csiph-web