On May 01, 2013, at 08:47 PM, Georg Brandl wrote: >Wait a moment... it might not be immediately useful for IntEnums (however, >that's because base Enum currently defines __int__ which I find questionable),
And broken. And unnecessary. :) >>> class Foo(Enum): ... a = 'a' ... b = 'b' ... >>> int(Foo.a) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: __int__ returned non-int (type str) ...remove Enum.__int__()... >>> class Bar(int, Enum): ... a = 1 ... b = 2 ... >>> int(Bar.a) 1 So yes, Enum.__int__() should be removed. -Barry _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com