OrderedEnum examples

Ian Kelly ian.g.kelly at gmail.com
Tue Jul 30 14:58:27 EDT 2013


On Tue, Jul 30, 2013 at 12:18 PM, Bas van der Wulp <Bas.vdWulp at 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.



More information about the Python-list mailing list