Guido van Rossum wrote:
Sounds to me really strange that the nested class would become a member.
Probably because everything becomes a member unless it's a function
(maybe decorated)?
Maybe it would have been better if Enums got told what type
their members are supposed to be, an only decorated things
of that type.
class Color(Enum):
__type__ = int
RED = 1
GREEN = 2
BLUE = 3
i_get_left_alone = 4.2
Or perhaps this could be made to work somehow:
class Color(Enum(int)):
RED = 1
GREEN = 2
BLUE = 3
i_get_left_alone = 4.2
--
Greg
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/