From c7740fc0b96ea34f148682b474197fd6ea31db8a Mon Sep 17 00:00:00 2001 From: Michael Jalkio Date: Sat, 2 Dec 2023 01:05:39 +0000 Subject: [PATCH] Obey new Flake8 rule --- year_2020/day19/monster_messages.py | 2 +- year_2021/day18/snailfish.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/year_2020/day19/monster_messages.py b/year_2020/day19/monster_messages.py index 4e71094..1eb2846 100644 --- a/year_2020/day19/monster_messages.py +++ b/year_2020/day19/monster_messages.py @@ -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] diff --git a/year_2021/day18/snailfish.py b/year_2021/day18/snailfish.py index 1034c18..ed926a0 100644 --- a/year_2021/day18/snailfish.py +++ b/year_2021/day18/snailfish.py @@ -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])