Skip to content

Commit

Permalink
Obey new Flake8 rule
Browse files Browse the repository at this point in the history
  • Loading branch information
mjalkio committed Dec 2, 2023
1 parent 9b7c96f commit c7740fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion year_2020/day19/monster_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_valid_messages(rule_definitions, max_valid_message_length=100):
# We've already included the valid messages for this rule
continue

if not type(subrule_lists[0][0]) == int:
if not isinstance(subrule_lists[0][0], int):
# If it's not a digit, it's a single character rule
# Single character rules can be added immediately
single_character_rule = subrule_lists[0][0]
Expand Down
2 changes: 1 addition & 1 deletion year_2021/day18/snailfish.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def snailfish_magnitude(number):
def _magnitude(number):
if type(number) == int:
if isinstance(number, int):
return number

left = _magnitude(number[0])
Expand Down

0 comments on commit c7740fc

Please sign in to comment.