Search⌘ K

Summary

Understand various Python data structures such as tuples, NamedTuples, dataclasses, dictionaries, lists, sets, and queues that support efficient object-oriented design. Learn how to apply inheritance, composition, and built-in classes to build flexible and maintainable Python applications.

We'll cover the following...

Conclusion

Up till now, we’ve seen a total of four ways to address object-oriented design and implementation.

  • In previous chapters, we looked at creating objects from scratch, writing all the method definitions ourselves. We’ve emphasized inheritance among the classes in the Sample class hierarchy.
  • In this chapter, we’ve seen a stateful class definition using @dataclass. This supports inheritance among the classes in the Sample class hierarchy.
  • We’ve also seen a stateless (or immutable) definition using @dataclass(frozen=True). This tends
...