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


Groups > comp.lang.python > #50279

Re: Recursive class | can you modify self directly?

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 <ian.g.kelly@gmail.com>
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 <CALwzidnfRrKkXbyn6q2-4qOik+byX=MtGBeeno9TX6=rqN79ag@mail.gmail.com>
References <61751485-a298-403e-8b44-be7cf2504f0e@googlegroups.com> <CALwzidnfRrKkXbyn6q2-4qOik+byX=MtGBeeno9TX6=rqN79ag@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Tue, 9 Jul 2013 16:20:47 -0600
Subject Re: Recursive class | can you modify self directly?
To Python <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.4476.1373408491.3114.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Tue, Jul 9, 2013 at 4:18 PM, Ian Kelly <ian.g.kelly@gmail.com> 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.

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


Thread

Recursive class | can you modify self directly? Russel Walker <russ.pobox@gmail.com> - 2013-07-09 15:01 -0700
  Re: Recursive class | can you modify self directly? Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-09 16:18 -0600
  Re: Recursive class | can you modify self directly? Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-09 16:20 -0600
    Re: Recursive class | can you modify self directly? Russel Walker <russ.pobox@gmail.com> - 2013-07-10 02:00 -0700
  Re: Recursive class | can you modify self directly? Dave Angel <davea@davea.name> - 2013-07-09 18:30 -0400
  Re: Recursive class | can you modify self directly? Ethan Furman <ethan@stoneleaf.us> - 2013-07-09 15:19 -0700
  Re: Recursive class | can you modify self directly? Russel Walker <russ.pobox@gmail.com> - 2013-07-10 01:58 -0700
    Re: Recursive class | can you modify self directly? Terry Reedy <tjreedy@udel.edu> - 2013-07-10 15:33 -0400
      Re: Recursive class | can you modify self directly? Russel Walker <russ.pobox@gmail.com> - 2013-07-10 13:09 -0700
  Re: Recursive class | can you modify self directly? Russel Walker <russ.pobox@gmail.com> - 2013-07-10 15:50 -0700
    Re: Recursive class | can you modify self directly? Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-10 17:39 -0600

csiph-web