The property factory is nice, but have you considered subclassing property?
class Mode(property):
def __init__(self, *vals):
if [v for v in vals if not isinstance(v,str)]:
raise ValueError, 'Mode values must be strings'
else:
self.values = list(vals)
property.__init__(self, self.get, self.set)
def get(self, instance):
...
def set(self, instance, value):
...
--
http://mail.python.org/mailman/listinfo/python-list
