> Like that? > > >>> class M2(enum.EnumMeta): >... def __contains__(self, value): >... print(value, "? never", sep="") >... return False >... > >>> Colors.__class__ > <class '__main__.M'> > >>> Colors.red in Colors > checking Colors.red > True > >>> Colors.__class__ = M2 > >>> Colors.red in Colors > Colors.red? never > False
Hah, that's pretty clever:) I was thinking without creating my own meta class, but modifying the Colors class. It's not really a big deal all the solutions here are more than adequate! Thanks a lot Peter, jlc -- https://mail.python.org/mailman/listinfo/python-list