Loading topic
set() constructor, comprehensions, and conversion from other collections. It also covers the empty-set trap and what happens to duplicates and order. It assumes you know basic Python syntax and variables, and that you are comfort6 min read__init__, __eq__). It explains the rule that decides whether a value can be a set element, why the rule exists, and what to do when a value fails it.5 min readfor loops and the in operator work, and the difference between mutable and immutable objects. You should also have seen how to create a set. Here you will learn how in behaves on sets, what "equal" means to a set, and what you can and cann5 min readin. It also assumes you know that set elements must be hashable and that mutable objects can change after you create them. Here you will learn the methods that change a set after creation: add, update, remove, discard, `pop4 min readin, and know that set elements must be hashable. Here you learn the four operations that build a new set from two or more existing sets. You also learn how the operator forms differ from the method forms, and where each one fails.5 min readin, and combine sets with |, &, - and ^. It also assumes you know that set elements must be hashable. Here you will learn how to ask questions about the relationship between two sets: is one contained in the other, are they ide6 min readset(items) is not enough.5 min readfrozenset 6 min readin on them, and know that set elements must be hashable. It explains the mechanism behind those facts: how a set finds an element without scanning, when that speed breaks down, and what the speed costs.7 min read