例子:
complete_dict = dict()
common_set = set()
for count, group_name in enumerate(groups_dict):
complete_dict[group_name] = dict() # grabs a json file = group_name.json
if count > 0:
common_set.intersection_update(complete_dict[group_name])
else:
# this accounts for the fact common_set is EMPTY to begin with
common_set.update(complete_dict[group_name])
WHERE:dict2
包含 k:v 个成员(组):int(x)
是否有更合适的方法来处理交叉口的初始状态?
即我们不能与第一个相交complete_dict[group_name]
,common_set
因为它是空的,因此结果也是空的。