from fastset import set users set(['bob''emily''howard''peeper']users set(['jerry''howard''carol']users set(['emily''carol']users users users users users users users (users users users users data {'peeper'none'bob'none'howard'none'emily'nonethe main functional difference in this version is the order of items in the setbecause dictionaries are randomly orderedthis set' order will differ from the original the order of results can even vary across python releases (in fact it didbetween python and in the third and fourth editions of this bookfor instanceyou can store compound objects in setsbut the order of items varies in this versionimport setfastset set set([( , )( , )( , )] set set([( , )( , )] fastset set([( , )( , )( , )] fastset set([( , )( , )] sets aren' supposed to be ordered anyhowso this isn' showstopper deviation that might matterthoughis that this version cannot be used to store unhashable (that isimmutableobjects this stems from the fact that dictionary keys must be immutable because values are stored in keysdictionary sets can contain only things such as tuplesstringsnumbersand class objects with immutable signatures mutable objects such as lists and dictionaries won' work directly in this dictionary-based setbut do in the original set class tuples do work here as compound set itemsthoughbecause they are immutablepython computes hash values and tests key equality as expectedset set([[ ],[ ]]fastset set([[ ],[ ]]typeerrorunhashable type'list data structures