I was wondering whether there is more pythonic way or even if it's acceptable to do it this way.
I want to call to some method inside list comprehension, although i don't need any value to be returned, it's just a setter.
Code:
def do_logic(self):
[self.set_key(j) for i in xrange(2, CONSTANT) if self.lis[i] != 1 for j in xrange(i*2, CONSTANT, i)]
In my eyes it doesn't seem like the right way to it, any suggestions?