Set Practice: learning from Python's set types
Key takeaways: 1. Set operations enable simpler and faster solutions for many tasks; 1. Python’s set classes are lessons in elegant, idiomatic API design; 1. A set class is a suitable context for implementing operator overloading. Boolean logic and set theory are closely related. In practice, we will see cases where set operations provide simple and fast declarative solutions to programming problems that otherwise require complicated and slow procedural coding. Python’s set built-ins …