Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.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.116 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.80; '*S*': 0.03; 'modified': 0.07; 'modify': 0.07; 'def': 0.12; 'minus': 0.16; 'subject:class': 0.16; 'wrote:': 0.18; 'import': 0.22; 'header:In-Reply-To:1': 0.27; 'forgot': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'that.': 0.31; 'something': 0.35; 'received:google.com': 0.35; 'object,': 0.36; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'subject:can': 0.39; 'to:addr:python.org': 0.39; 'remove': 0.60; 'ian': 0.60; 'jul': 0.74; 'subject:self': 0.84; 'subject:you': 0.87; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=kauz/2Jr4wDFNkv7Ec8wYsCcaArT2n1yKnNeVwkuf4I=; b=qvKFc1Mk2LOoHYqq/KCQMj4/qPz6a2zyX1El+Unw6TTSS+pzZDM+9DCoGDRfEKJVKu EN273e0pt/QYX/ffoQkkpkwr8ML7GadKylOV0bY2b+IglQ5F5qPDC8T9yLIhy3pbcNtS ODNHIPt3cBMmNzyUPp6x24KGiesnf/T+CW62bfd4CBNFW9HdVOyDxGl9HC4fk+kPwXvw 0WnXtYPE2s3hO+7D2J6yhoAaZ0CDyAXwU1Ao44g7t083nncAd7jmgWd0UBaIRJepLaqu kRmK2helYzLwQokHrQsYi9igUlbKNaFq6hnQKJt5hxK3znBDaRUhNMMz7tM7A649SITa 6DAA== X-Received: by 10.68.213.5 with SMTP id no5mr28479655pbc.185.1373408487734; Tue, 09 Jul 2013 15:21:27 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <61751485-a298-403e-8b44-be7cf2504f0e@googlegroups.com> From: Ian Kelly Date: Tue, 9 Jul 2013 16:20:47 -0600 Subject: Re: Recursive class | can you modify self directly? To: Python 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1373408491 news.xs4all.nl 15959 [2001:888:2000:d::a6]:32910 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50279 On Tue, Jul 9, 2013 at 4:18 PM, Ian Kelly wrote: > If you actually want to modify the current object, you would need to > do something like: > > def expand(self): > import copy > self.expr = Expr(self.expr, self.op, self.val) > self.op = choice('+-*/') > self.val = choice('12345') Minus the "import copy". I modified the code before sending and forgot to remove that.