Skip to Content
Mastering Python 2E - Second Edition
book

Mastering Python 2E - Second Edition

by Rick Hattem
May 2022
Intermediate to advanced
710 pages
16h 41m
English
Packt Publishing
Content preview from Mastering Python 2E - Second Edition

4

Pythonic Design Patterns

The previous chapter covered a lot of guidelines for what to do and what to avoid in Python. Next, we will explore a few examples of how to work in a Pythonic way using the modules included with Python.

Design patterns are largely dependent on storing data; for this, Python comes bundled with several very useful collections. The most basic collections such as list, tuple, set, and dict will already be familiar to you, but Python also comes bundled with more advanced collections. Most of these simply combine the basic types for more powerful features. In this chapter, I will explain how to use these data types and collections in a Pythonic fashion.

Before we can properly discuss data structures and related performance, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Object-Oriented Python - Second Edition

Mastering Object-Oriented Python - Second Edition

Steven F. Lott

Publisher Resources

ISBN: 9781800207721Supplemental Content