Steve Jorgensen wrote:
Oops. Obviously, the above is pseudo-code because I left ('~OTHER~', 'Something else') the first assert, and I have (Food, Food) instead of (Food,) * 4 for the second assert. Possibly some other mistakes as well.
Umm, like the fact that I'm testing for colors instead of foods since I changed the kind of example case. :) Here's an updated example, minus the comments — still pseudocode with possible mistakes: from choices import ChoicesContext # Get choices context for Food choices. fcc = ChoicesContext() class Food(fcc.base): fcc.APPLE fcc.GREEK_YOGURT fcc.EGG_MCMUFFIN %= 'Egg McMuffin' fcc.append('~OTHER~', 'Something else') assert ( (Food.Apple, Food.GREEK_YOGURT, fcc.EGG_MCMUFFIN) == ('APPLE', 'GREEK_YOGURT', 'EGG_MCMUFFIN')) assert tuple(Food) == ( ('APPLE', 'Apple'), ('GREEK_YOGURT', 'Greek Yogurt'), ('EGG_MCMIFFIN', 'Egg McMuffin'), ('~OTHER~', 'Something else'), ) assert tuple(type(food) for food in Food) == (Food,) * 4