Dictionary clear() as a code smell
Using the clear() method of a dict isn't *wrong*. But. The reasons have to be investigated. I got a question about this code not working "properly." ("Properly"? Seems too vague to be useful.)
Here's a summary of the example.
final_list = [] temp_dict = {} for obj in some_source: cool_function(obj, temp_dict) final_list.append …more ...