Summary

We've covered several built-in data structures and attempted to understand how to choose one for specific applications. Sometimes the best thing we can do is create a new class of objects, but often, one of the built-ins provides exactly what we need. When it doesn't, we can always use inheritance or composition to adapt them to our needs. In particular, we covered:

  • Tuples and named tuples
  • Dictionaries and default dictionaries
  • Lists and sets
  • Overriding special variables on built-ins

In the next chapter we'll discuss how to integrate the object-oriented and not-so-object-oriented aspects of Python. Along the way, we'll discover that it's more object-oriented than it looks at first sight!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.33.235