Remove Duplicate Set Key
Documentation Index
Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
Use this file to discover all available pages before exploring further.
Sourcery refactoring id: remove-duplicate-set-key
Section titled “Sourcery refactoring id: remove-duplicate-set-key”Description:
Section titled “Description:”Remove duplicate keys when instantiating sets.
Before:
Section titled “Before:”addresses = {"here", *address_list1, *address_list2, *address_list1, "there", "here"}After:
Section titled “After:”addresses = {*address_list2, *address_list1, "there", "here"}Explanation:
Section titled “Explanation:”Set keys must be unique. Hence, repeated keys are redundant and can be removed from its inialization to increase the conciseness and clarity of the code.