# set (1-set.us) A set is a group of things that belong together. People put things in a set when they want to keep them as a collection. ## What a model may hear - mutable data structure (Python, Java, and other programming languages): Create an unordered collection of unique hashable elements, automatically removing duplicates - assignment operation (programming and scripting generally): Store a value in a variable, register, or memory location - database write (Redis and key-value stores): Store a key-value pair, overwriting any existing value - mathematical collection (mathematics and formal logic): Treat the input as an abstract collection with operations like union, intersection, and subset testing - shell command (Unix/Linux shells): Display or modify shell variables and environment settings ## Where people and models part ways - Says: "Put this in a set" Means: Organize these items together as a group May be taken as: Convert to a Python set, losing all duplicates and destroying order Say instead: "Keep these items in a list, but remove any duplicates" - Says: "Set the value to true" Means: Make this setting active May be taken as: Execute a low-level register or memory write instead of updating a configuration Say instead: "Update this configuration setting to true" - Says: "I have a set of three options" Means: There are three choices available May be taken as: Assume the options are in a set data structure, which cannot be indexed by position Say instead: "There are three options to choose from" - Says: "Set it up for me" Means: Configure or prepare this for me May be taken as: Attempt to assign a variable named 'it' to a value named 'up', or invoke a setup function Say instead: "Configure this for me" ## Tips - Say 'collection' or 'group' if you do not need duplicate removal or unordered storage - Say 'assign' or 'store' when you mean to put a value into a variable - Say 'configure' or 'update' when you mean to change a setting - Specify 'mathematical set' if you actually want set-theory operations - Say 'ordered list' if sequence and duplicates both matter ## Often confused with - list: ordered, allows duplicates, indexable - array: fixed-size, indexed, often homogeneous - dict: maps keys to values, not just elements - tuple: immutable, ordered, allows duplicates - assign: only stores a value, no collection meaning - configure: only changes settings, no data structure meaning