I would like doing:
class Whatevs(object):
foo = 3
bar = foo * 3
def __init__(self):
# enhance!
or How acan I make it possible to work correctly. ;)
EDIT:
Ok, it turns out that that is not the problem, the above works fine, this though:
class Whatevs(object):
foo = 3
zap = list(foo for _ in range(10))
Oh you, Python! I can come up with some workarounds, but can someone explain to me what is going on precisely? Why can't the generator access the class variables?