Can this be simplified to a single one-liner, without the one liner being more difficult to read?
if self.is_running:
return
self.is_running = True
Something like:
return if self.is_running else self.is_running = True
(Obviously the above won't work, just an example of what i'm looking to achieve)