BUG : fix list comprehensions over class members

Due to scoping fixes in py3k, list comprehensions over class level
attributes during class definition does not work (see
http://stackoverflow.com/questions/13905741/accessing-class-variables-from-a-list-comprehension-in-the-class-definition).

Superficially Fixes #3436. There seem to be other issues
indeed, fixed it earlier today, but didn't get the commit pushed up till now.