Skip to content

Instantly share code, notes, and snippets.

@fletom
Created January 20, 2012 20:26
Show Gist options
  • Save fletom/1649392 to your computer and use it in GitHub Desktop.
Save fletom/1649392 to your computer and use it in GitHub Desktop.
def is_hidden(self):
if self.state == 'HIDDEN':
return True
return False
@amcgregor
Copy link

Love it. I also, depressingly, see Python developers doing this all the time. My favourite variant:

return True if self.state == 'HIDDEN' else False

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment