Skip to content

Comments

Consider using not in per PEP 8#15

Open
dsiddy wants to merge 1 commit intoAzure-Samples:masterfrom
dsiddy:patch-1
Open

Consider using not in per PEP 8#15
dsiddy wants to merge 1 commit intoAzure-Samples:masterfrom
dsiddy:patch-1

Conversation

@dsiddy
Copy link

@dsiddy dsiddy commented Apr 8, 2020

pycodestyle's rule E713 mandates this, presumably because PEP 8 points out something similar:

Use is not operator rather than not ... is. While both expressions are functionally identical, the former is more readable and preferred[.]

I happen to agree with this assessment, and hope that y'all will consider making the switch. 😊

Purpose

  • Makes the example code more readable (in my opinion) and conformable to standards.

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[ ] Feature
[x] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
git clone https://github.com/dsiddy/cognitive-services-qnamaker-python
cd cognitive-services-qnamaker-python
git checkout patch-1
npm install
  • Test the code
cat documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.py

What to Check

Verify that the following are valid

  • Lines 19 and 24 have been modified to use not in rather than not ... in.

Other Information

Thanks for maintaining! 👍

`pycodestyle`'s [rule E713](https://hyp.is/RMY0AHmrEeq0f9dUIBJwPA/pycodestyle.pycqa.org/en/latest/intro.html) mandates this, presumably because [PEP 8](https://www.python.org/dev/peps/pep-0008/) points out something similar:

> Use `is not` operator rather than `not ... is`. While both expressions are functionally identical, the former is more readable and preferred[.]

I happen to agree with this assessment, and hope that y'all will consider making the switch. 😊
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant