Created
July 25, 2018 02:22
-
-
Save frankandrobot/8161e873651166dc6e2af1b675c9cebb to your computer and use it in GitHub Desktop.
simple brain teaser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_visible(object_value, current_visibility, desired_visibility): | |
specified = object_value['visibility'] | |
if current_visibility == 'hide': | |
if desired_visibility == 'show': | |
return specified == desired_visibility | |
else: | |
return True | |
# current_visibility is "show"... | |
if desired_visibility == 'show': | |
return specified == desired_visibility or specified is None | |
else: | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment