ssc wrote:
class SignupForm(Form):titles = ['Dr', 'Miss', 'Mr', 'Mrs', 'Ms',] title_choices = [(0, '')] + list((titles.index(t)+1, t) for t in titles) Does the generator expression have its own little namespace or so ?
Yes. The generator expression is a function, with its own local namespace. Since the class scope is not visible from inside functions declared within it, the behaviour you're seeing results. -- Greg -- http://mail.python.org/mailman/listinfo/python-list