Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Python: Real-World Data Science

You're reading from   Python: Real-World Data Science Real-World Data Science

Arrow left icon
Product type Course
Published in Jun 2016
Publisher
ISBN-13 9781786465160
Length 1255 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (5):
Arrow left icon
Fabrizio Romano Fabrizio Romano
Author Profile Icon Fabrizio Romano
Fabrizio Romano
Phuong Vo.T.H Phuong Vo.T.H
Author Profile Icon Phuong Vo.T.H
Phuong Vo.T.H
Robert Layton Robert Layton
Author Profile Icon Robert Layton
Robert Layton
Sebastian Raschka Sebastian Raschka
Author Profile Icon Sebastian Raschka
Sebastian Raschka
Martin Czygan Martin Czygan
Author Profile Icon Martin Czygan
Martin Czygan
+1 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Table of Contents FREE CHAPTER
Python: Real-World Data Science
Meet Your Course Guide
What's so cool about Data Science?
Course Structure
Course Journey
The Course Roadmap and Timeline
1. Course Module 1: Python Fundamentals 2. Course Module 2: Data Analysis 3. Course Module 3: Data Mining 4. Course Module 4: Machine Learning Index

Chapter 11. Python Design Patterns I

In the last chapter, we were briefly introduced to design patterns, and covered the iterator pattern, a pattern so useful and common that it has been abstracted into the core of the programming language itself. In this chapter, we'll be reviewing other common patterns, and how they are implemented in Python. As with iteration, Python often provides an alternative syntax to make working with such problems simpler. We will cover both the "traditional" design, and the Python version for these patterns. In summary, we'll see:

  • Numerous specific patterns
  • A canonical implementation of each pattern in Python
  • Python syntax to replace certain patterns

The decorator pattern

The decorator pattern allows us to "wrap" an object that provides core functionality with other objects that alter this functionality. Any object that uses the decorated object will interact with it in exactly the same way as if it were undecorated (that is...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image