not
detected PYL-C0113 66 lg.warning('There was something wrong with the data.json; fixing...')
67if not 'sha' in data.keys():
68 data['sha'] = {}
69if not 'last' in data.keys(): 70 lg.warning('No last update date found; setting standard')
71 data['last'] = '1999-12-01'
72
64 lg.warning('data.json not found; creating...')
65except json.JSONDecodeError:
66 lg.warning('There was something wrong with the data.json; fixing...')
67if not 'sha' in data.keys(): 68 data['sha'] = {}
69if not 'last' in data.keys():
70 lg.warning('No last update date found; setting standard')
The boolean expression contains an unneeded negation and can be re-written without using the not
statement.
def categorize_number(num):
if not num % 2 == 0:
print("The number is odd.")
else:
print("The number is even.")
Here, the condition not num % 2 == 0
contains an unneeded not
and can be changed into num % 2 != 0
.
A clearer and more straightforward approach would look like this:
def categorize_number(num):
if num % 2 != 0:
print("The number is odd.")
else:
print("The number is even.")