Empty Objects
Explore how Python's built-in empty object class works, why it restricts setting attributes, and understand the role of empty objects versus data structures like tuples, dictionaries, and dataclasses in organizing data efficiently within object-oriented design.
We'll cover the following...
We'll cover the following...
In our examples so far, we’ve already seen many of the built-in Python data structures in action. In this chapter, we’ll discuss the object-oriented features of these data structures, when they should be used instead of a regular class, and when they should not be used. In particular, we’ll be covering the following topics:
- Tuples and named tuples
- Dataclasses
- Dictionaries
- Lists and sets
- Three types of queues
This chapter’s case study will revisit the data model for the ...