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


Groups > comp.lang.python > #51596

Re: OrderedEnum examples

References <51f8036c$0$2995$6d4158fb@reader.xsnews.nl>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2013-07-30 12:58 -0600
Subject Re: OrderedEnum examples
Newsgroups comp.lang.python
Message-ID <mailman.5335.1375210751.3114.python-list@python.org> (permalink)

Show all headers | 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