not
detected PYL-C0113 33 return
34 if payload.channel_id != db_guild.channel_booster_emoji:
35 return
36 if not str(payload.emoji) in ['✅', '❌']: 37 return
38 if not gatekeeper.has(payload.member.guild, payload.member, 5):
39 await msg.remove_reaction(payload.emoji, payload.member)
1037 formatted_error = traceback.format_exc()
1038 if str(error) == loc["error"]["no_pm"]:
1039 return await ctx.send(loc["error"]["no_pm"])
1040 if not (str(error) == "Application Command raised an exception: AttributeError: 'NoneType' object has no attribute 'is_finished'"):1041 await ctx.send(loc["error"]["error_msg"].format(str(error)))
1042 if hasattr(ctx, "voice_state") and ctx.voice_state:
1043 if ctx.voice_state.debug["debug_log"]:
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.")