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


Groups > comp.lang.python > #51596

Re: OrderedEnum examples

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.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.150
X-Spam-Level *
X-Spam-Evidence '*H*': 0.73; '*S*': 0.03; 'attribute': 0.07; 'expected.': 0.09; 'python': 0.11; 'renamed': 0.16; 'wrote:': 0.18; 'replacing': 0.19; 'examples': 0.20; 'seems': 0.21; 'example': 0.22; 'looks': 0.24; 'van': 0.27; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'probably': 0.32; 'url:python': 0.33; 'updated': 0.34; 'received:google.com': 0.35; 'in:': 0.36; 'url:org': 0.36; 'should': 0.36; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'name': 0.63; '30,': 0.65; 'here': 0.66; 'detail.': 0.68; 'jul': 0.74; 'self.value': 0.84; 'url:cpython': 0.84; 'url:rev': 0.84; '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=v+jPByzBiDKyNlQdfvYXDe2eSKmaL7sbZkzfG2k8mzs=; b=V6k03yvtlGjny4NVsD7m5A0TTMOZHTYeTnxusVD2sDVi3c1/rym9jY5dA1hfL5aD0v LlcmI6+/bTi++eRf5gyhYg45BBTRXjJGS0r63MnjKV+PPgorcZQF6CdLMKYI+b4AWaJ2 Ozps4DkuenkjsG2xDIvtAux4zz2fC7EB2IhJjE5XkKoK6hiMArKxt2e2Pppv+xykrjoP nTj/HQmEdSpybDnvbpWjZ7ptsHv9a8/WePuavYUhDJR5A/axzaNlZwFK6fb6YY5OO/kS AZXckvMV+Q1FOawQe+38O4KqOj9WJldxauLdDkB1oJL8rPGCFyn+Z+ZdEE+qcKyyMZ8s CtXw==
X-Received by 10.66.228.38 with SMTP id sf6mr867847pac.21.1375210748087; Tue, 30 Jul 2013 11:59:08 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <51f8036c$0$2995$6d4158fb@reader.xsnews.nl>
References <51f8036c$0$2995$6d4158fb@reader.xsnews.nl>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Tue, 30 Jul 2013 12:58:27 -0600
Subject Re: OrderedEnum examples
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.5335.1375210751.3114.python-list@python.org> (permalink)
Lines 13
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1375210751 news.xs4all.nl 15953 [2001:888:2000:d::a6]:34252
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:51596

Show key headers only | View raw


On Tue, Jul 30, 2013 at 12:18 PM, Bas van der Wulp <Bas.vdWulp@gmail.com> wrote:
> Replacing each occurrence of self._value with either self._value_ or
> self.value in the examples seems to make them work as expected.
>
> Are both examples incorrect, or not intended to work in Python 2.x?

The _value attribute was renamed _value_ in:

http://hg.python.org/cpython/rev/511c4daac102

It looks like the example wasn't updated to match.  You should
probably just use self.value here since the name of the private
attribute is an implementation detail.

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


Thread

OrderedEnum examples Bas van der Wulp <Bas.vdWulp@gmail.com> - 2013-07-30 20:18 +0200
  Re: OrderedEnum examples Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-30 12:58 -0600
  Re: OrderedEnum examples Ethan Furman <ethan@stoneleaf.us> - 2013-07-30 11:38 -0700
  Re: OrderedEnum examples Ethan Furman <ethan@stoneleaf.us> - 2013-07-30 12:16 -0700
  Re: OrderedEnum examples Ethan Furman <ethan@stoneleaf.us> - 2013-07-30 12:30 -0700
    Re: OrderedEnum examples Bas van der Wulp <Bas.vdWulp@gmail.com> - 2013-07-31 00:30 +0200

csiph-web