From 3ef6339d08f1d87c06df629dfc5d84238d58610f Mon Sep 17 00:00:00 2001 From: Dan Siddoway Date: Wed, 8 Apr 2020 08:13:19 -0700 Subject: [PATCH] Consider using `not in` per PEP 8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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. 😊 --- .../knowledgebase_quickstart/knowledgebase_quickstart.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.py b/documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.py index 5841e3e..de39f2c 100644 --- a/documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.py +++ b/documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.py @@ -16,12 +16,12 @@ # key_var_name = 'QNAMAKER_KEY' -if not key_var_name in os.environ: +if key_var_name not in os.environ: raise Exception('Please set/export the environment variable: {}'.format(key_var_name)) subscription_key = os.environ[key_var_name] host_var_name = 'QNAMAKER_HOST' -if not host_var_name in os.environ: +if host_var_name not in os.environ: raise Exception('Please set/export the environment variable: {}'.format(host_var_name)) host = os.environ[host_var_name] #