Skip to content

Mypy: incompatible type error during set update

Mypy returns an error if the set is updated with new tuple using add() code.py error body As far as I know, it is common practice to add new tuplets to the set. The add() method can add a tuple object as an element in the set Why does mypy think it’s not allowed? Answer adgroups_by_campaign_id is marked…

Unexpected UserDict Behavior

I am working on a project and need to make use of UserDict instead of dict. I am importing a JSON file that is a dictionary with lists containing more dictionaries. Here is some example code and the behavior differences I am seeing: The output: Why did the new key not get added to person_user_dict and how can…