Writing a blog post on the new Enum.
Terry Jan Reedy
tjreedy at udel.edu
Tue May 14 11:07:58 EDT 2013
On 5/14/2013 3:52 AM, Chris Angelico wrote:
> On Tue, May 14, 2013 at 9:40 AM, Fábio Santos <fabiosantosart at gmail.com> wrote:
>> http://fabiosantoscode.blogspot.pt/2013/05/pythons-new-enum-class.html
>
> class Text(unicode, Enum):
> one = u'one'
> two = u'two'
> three = u'three'
Is this supposed to be a quote? or your rewrite? or did Santos rewrite
after you posted? The blog currently has a 3.x version of that.
> That looks like Python 2 code. Are you backporting Enum to Py2
> manually? AIUI the Python core won't be adding features like that to
> 2.7, and there won't be a 2.8, so PEP 435 will be Py3.4+ only. Or have
> I misunderstood it?
As far as official CPython goes, Enum is 3.4+ only. I believe the module
will continue to work on earlier 3.x and will remain externally
available as a 3rd party module. Ethan said he plans to backport to 2.7
so 2 & 3 code can use enums.
More information about the Python-list
mailing list