Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SyntaxWarning where 'is' is used rather than '==' #112

Merged
merged 1 commit into from
Aug 5, 2020
Merged

Fix SyntaxWarning where 'is' is used rather than '==' #112

merged 1 commit into from
Aug 5, 2020

Conversation

PureTryOut
Copy link
Contributor

Without this MR at least Python 3.8 will complain:

/usr/lib/python3.8/site-packages/lingua_franca/lang/format_en.py:293: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if abs(num) < 1.0 and (result is "minus " or not result):
/usr/lib/python3.8/site-packages/lingua_franca/lang/format_pt.py:108: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if abs(num) < 1.0 and (result is "menos " or not result):
/usr/lib/python3.8/site-packages/lingua_franca/lang/format_it.py:387: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if abs(num) < 1.0 and (result is "meno " or not result):
/usr/lib/python3.8/site-packages/lingua_franca/lang/format_es.py:197: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if abs(num) < 1.0 and (result is "menos " or not result):
/usr/lib/python3.8/site-packages/lingua_franca/lang/format_fr.py:195: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if abs(num) < 1.0 and (result is "moins " or not result):
/usr/lib/python3.8/site-packages/lingua_franca/lang/parse_en.py:404: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if ordinals and prev_word in string_num_ordinal and val is 1:

@devs-mycroft devs-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label May 3, 2020
@ChanceNCounter
Copy link
Contributor

Looks good. I'm gonna tag "don't merge" for a couple days so that we can merge this onto an anticipated refactor, rather than rebasing that huge branch for what would be the third time.

But, otherwise, looks correct at first glance.

@ChanceNCounter ChanceNCounter merged commit d8f9840 into MycroftAI:master Aug 5, 2020
@PureTryOut PureTryOut deleted the silence-syntaxwarning branch August 6, 2020 10:06
ChanceNCounter pushed a commit that referenced this pull request Aug 21, 2020
Merging: repeat occurrence of PR #112 discovered post-release.
ChanceNCounter pushed a commit to ChanceNCounter/lingua-franca that referenced this pull request Oct 9, 2020
ChanceNCounter pushed a commit to ChanceNCounter/lingua-franca that referenced this pull request Dec 3, 2020
ChanceNCounter pushed a commit to ChanceNCounter/lingua-franca that referenced this pull request Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants