File .deepsource.toml
not found in the default branch of the repository root. Please refer to the docs.
457 except Customer.DoesNotExist:
458 continue
459 sub_items = subscription["items"]
460 item_ids = set([x["price"]["id"] for x in sub_items["data"]]) | set(461 [x["price"]["product"] for x in sub_items["data"]]
462 )
463 matching_plans = list(filter(lambda x: x[1] & item_ids, lotus_plans))
457 except Customer.DoesNotExist:
458 continue
459 sub_items = subscription["items"]
460 item_ids = set([x["price"]["id"] for x in sub_items["data"]]) | set(461 [x["price"]["product"] for x in sub_items["data"]]
462 )
463 matching_plans = list(filter(lambda x: x[1] & item_ids, lotus_plans))
Although there is nothing syntactically wrong with this code, it is hard to read and can be simplified to a set comprehension. Using set comprehension is more performant since there is no need to create a transient list.
mapping = set([num for num in my_magic_nums])
mapping = {num for num in my_magic_nums}