Skip to content

Commit

Permalink
Fix SyntaxWarning where 'is' is used rather than '==' (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
PureTryOut authored Aug 5, 2020
1 parent 73b3415 commit d8f9840
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lingua_franca/lang/format_en.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def _long_scale(n):
return pronounce_number_en(num, places, short_scale, scientific=True)
# Deal with fractional part
elif not num == int(num) and places > 0:
if abs(num) < 1.0 and (result is "minus " or not result):
if abs(num) < 1.0 and (result == "minus " or not result):
result += "zero"
result += " point"
_num_str = str(num)
Expand Down
2 changes: 1 addition & 1 deletion lingua_franca/lang/format_es.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def pronounce_number_es(num, places=2):
# instead the dot. Decimal part can be written both with comma
# and dot, but when pronounced, its pronounced "coma"
if not num == int(num) and places > 0:
if abs(num) < 1.0 and (result is "menos " or not result):
if abs(num) < 1.0 and (result == "menos " or not result):
result += "cero"
result += " coma"
_num_str = str(num)
Expand Down
2 changes: 1 addition & 1 deletion lingua_franca/lang/format_fr.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def pronounce_number_fr(num, places=2):

# Deal with decimal part
if not num == int(num) and places > 0:
if abs(num) < 1.0 and (result is "moins " or not result):
if abs(num) < 1.0 and (result == "moins " or not result):
result += "zéro"
result += " virgule"
_num_str = str(num)
Expand Down
2 changes: 1 addition & 1 deletion lingua_franca/lang/format_it.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def _long_scale(n):

# Deal with fractional part
if not num == int(num) and places > 0:
if abs(num) < 1.0 and (result is "meno " or not result):
if abs(num) < 1.0 and (result == "meno " or not result):
result += "zero"
result += " virgola"
_num_str = str(num)
Expand Down
2 changes: 1 addition & 1 deletion lingua_franca/lang/format_pt.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def pronounce_number_pt(num, places=2):
# instead the dot. Decimal part can be written both with comma
# and dot, but when pronounced, its pronounced "virgula"
if not num == int(num) and places > 0:
if abs(num) < 1.0 and (result is "menos " or not result):
if abs(num) < 1.0 and (result == "menos " or not result):
result += "zero"
result += " vírgula"
_num_str = str(num)
Expand Down
2 changes: 1 addition & 1 deletion lingua_franca/lang/parse_en.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def _extract_whole_number_with_text_en(tokens, short_scale, ordinals):

# is the prev word an ordinal number and current word is one?
# second one, third one
if ordinals and prev_word in string_num_ordinal and val is 1:
if ordinals and prev_word in string_num_ordinal and val == 1:
val = prev_val

# is the prev word a number and should we sum it?
Expand Down

0 comments on commit d8f9840

Please sign in to comment.