File .deepsource.toml
not found in the default branch of the repository root. Please refer to the docs.
not
detected PYL-C0113 97 ili.metadata = subperiod["unique_identifier"]
98 ili.save()
99 # flat fee calculation for current plan
100 if not flat_fee_behavior == "refund":101 flat_costs_dict_list = sorted(
102 list(subscription.prorated_flat_costs_dict.items()), key=lambda x: x[0]
103 )
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.")