On 05/10/2013 10:15 PM, Glenn Linderman wrote:
But the last few lines of demo1 demonstrate that NIE doesn't like, somehow,
remember that its values, deep down under
the covers, are really int. And doesn't even like them when they are wrapped
into IntET objects. This may or may not
be a bug in the current Enum implementation.
You're right, sort of. ;)
If you do
print( repr( NIE1.x.value ))
you'll see
('NIE1.x', 1)
In other words, the value of NEI.x is `('NEI1.x', 1)` and that is what you would have to pass back into NEI to get the
enum member.
As an aside, I suspect you are doing this the hard way. Perhaps writing your own __new__ in NIE will have better
results (I'd try, but I gotta get some sleep! ;) . Oh, newest code posted.
--
~Ethan~
_______________________________________________
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