diff options
author | Fbenas <philbeansburton@gmail.com> | 2020-10-16 00:24:00 +0100 |
---|---|---|
committer | Fbenas <philbeansburton@gmail.com> | 2020-10-16 00:24:00 +0100 |
commit | ecf048b9c1fafffd8e6da1e666740c0311b50b7e (patch) | |
tree | 9cc3b86711d702a0f000671228dbbe1fb1e5210a /bladictionary.py | |
parent | b47464cb306ec152bec1500dfabeee503ebd0787 (diff) |
Replace and when comparing stirngs and ints
Diffstat (limited to 'bladictionary.py')
-rwxr-xr-x | bladictionary.py | 8 |
1 files changed, 4 insertions, 4 deletions
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 |