From ecf048b9c1fafffd8e6da1e666740c0311b50b7e Mon Sep 17 00:00:00 2001 From: Fbenas Date: Fri, 16 Oct 2020 00:24:00 +0100 Subject: Replace and when comparing stirngs and ints --- bladictionary.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bladictionary.py') diff --git a/bladictionary.py b/bladictionary.py index a7ca8ce..9fe1827 100755 --- a/bladictionary.py +++ b/bladictionary.py @@ -218,7 +218,7 @@ def parse_oed(word): #If we've reached a word type, add the current data to the list if part in types.keys(): #Don't add empty definitions - if id > 0 and definition is not " " and definition: + if id > 0 and definition != " " and definition: item = Definition(word, id, "oed", word_type, definition, [], [], []) items.append(item) definition = "" @@ -228,7 +228,7 @@ def parse_oed(word): elif part.isdigit() and prev_part is not None: #Ignore anything before the first definition - if part is not "1": + if part != "1": item = Definition(word, id, "oed", word_type, definition, [], [], []) items.append(item) definition = "" @@ -392,7 +392,7 @@ def main(): types = ["n", "v", "adj", "adv", "tech", "urban"] type_id = 0 - all_types = word_type is "" + all_types = word_type == "" #Normally we try and display 1 of each type if no type is specified #But if the word only has one type of definition, display all of them @@ -411,7 +411,7 @@ def main(): found_type = False cur_id = type_id if item.id < page_num: - if item.id is not 0: + if item.id != 0: continue elif item.id == 0 and page_num > 1: continue -- cgit v1.2.3