> Greg > 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
Enum already is callable - it creates Enum subclasses. e.g. Color = Enum("Color", ("RED", "GREEN", "BLUE")) (or something similar, I didn't check the docs.) In general, it sounds to me like you already can avoid them becoming members if you want - simply by making them a property. Therefore, letting them be members by default doesn't sound weird to me. As for embedded classes - well, the cannot be subclasses because the outer class is not instantiated. You could perhaps build a class decorator that injects the outer class in the inner class' MRO, but that doesn't sound like code I'd want to debug. _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/