Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'value,': 0.04; 'instance': 0.05; 'attribute.': 0.09; 'func': 0.09; 'stuck.': 0.09; 'this:': 0.10; '>>>': 0.12; 'am,': 0.14; 'result.': 0.14; 'wrote:': 0.14; 'binding,': 0.16; 'elsewhere,': 0.16; 'lambda': 0.16; 'simulate': 0.16; 'cheers,': 0.19; 'header:In-Reply-To:1': 0.21; 'variable': 0.21; 'seems': 0.21; 'thu,': 0.22; 'received:209.85.161.46': 0.23; 'received:mail-fx0-f46.google.com': 0.23; 'received:209.85.161': 0.26; 'message-id:@mail.gmail.com': 0.28; 'language.': 0.28; 'instead': 0.29; 'binding': 0.30; 'steven': 0.32; 'does': 0.33; 'to:addr:python-list': 0.33; "d'aprano": 0.35; 'stuck': 0.35; 'reference': 0.35; 'received:google.com': 0.37; 'something': 0.37; 'received:209.85': 0.37; 'but': 0.38; 'realize': 0.38; 'subject:: ': 0.38; 'received:209': 0.39; 'to:addr:python.org': 0.39; 'saving': 0.74 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:content-type; bh=dj7N3nmZC8MafVwi1nE9xt2KrsNZU2fAh5a+3iuoZ2E=; b=lqh7TfPr5/K86UHXpUZc1q82SwJoiEaUhXOn9EC2cYuBHgAtKjWSO33i3KGzUJ1h8v Q4psCaDChCTazdevSEwH9bYprhILS70o+O9SVEVXO2VuEKhBQFUlY+1UsZh4OXjluy77 6okTstLQ39WklpgYJQvo8wR5HvFkIV+gppq18= 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 :content-type; b=pVnIpQe6q2QrYysAgf7x/LxaXo3+PCGj+uwLoRS2oFlU3GzObiXreQ2YeoqWx89Fr9 mOPl4fz8VL0YJpmkbO03SkH+O/blTAt3tlKLNXMoozC4TIdk6fj/z5KoONef+IyYi1Q8 nb3AMD2i8HqTVJX70vr9OiZ9jjZrQbTULAPKk= MIME-Version: 1.0 In-Reply-To: <4de7c6e7$0$29996$c3e8da3$5496439d@news.astraweb.com> References: <2_AFp.30000$241.24052@newsfe07.iad> <4de71c42$0$29983$c3e8da3$5496439d@news.astraweb.com> <9oOFp.2056$Zp6.1700@newsfe19.iad> <4de7c6e7$0$29996$c3e8da3$5496439d@news.astraweb.com> From: Ian Kelly Date: Thu, 2 Jun 2011 11:43:08 -0600 Subject: Re: Something is rotten in Denmark... To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307036619 news.xs4all.nl 49041 [::ffff:82.94.164.166]:51859 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:6876 On Thu, Jun 2, 2011 at 11:22 AM, Steven D'Aprano wrote: > It seems to me that early binding is less flexible than late, because > with late binding you have a chance to simulate early binding by saving a > reference of the variable elsewhere, such as in a default value, or an > instance attribute. But with early binding, you're stuck. There's no > simple or straightforward way to simulate late binding in an early > binding language. Well, you can always do something like this: >>> a = box(42) >>> func = lambda x: a.value + x >>> func(1) 43 >>> a.value = 6 * 9 >>> func(1) 55 I realize that's not exactly the same thing since you're stuck working with "a.value" instead of just "a", but it does produce the desired result. Cheers, Ian