更新时间:2021-07-16 20:44:49
coverpage
Python 3 Object-oriented Programming Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files eBooks discount offers and more
Introduction to the second edition
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Chapter 1. Object-oriented Design
Introducing object-oriented
Objects and classes
Specifying attributes and behaviors
Hiding details and creating the public interface
Composition
Inheritance
Case study
Exercises
Summary
Chapter 2. Objects in Python
Creating Python classes
Modules and packages
Organizing module contents
Who can access my data?
Third-party libraries
Chapter 3. When Objects Are Alike
Basic inheritance
Multiple inheritance
Polymorphism
Abstract base classes
Chapter 4. Expecting the Unexpected
Raising exceptions
Chapter 5. When to Use Object-oriented Programming
Treat objects as objects
Adding behavior to class data with properties
Manager objects
Chapter 6. Python Data Structures
Empty objects
Tuples and named tuples
Dictionaries
Lists
Sets
Extending built-ins
Queues
Chapter 7. Python Object-oriented Shortcuts
Python built-in functions
An alternative to method overloading
Functions are objects too
Chapter 8. Strings and Serialization
Strings
Regular expressions
Serializing objects
Chapter 9. The Iterator Pattern
Design patterns in brief
Iterators
Comprehensions
Generators
Coroutines
Chapter 10. Python Design Patterns I
The decorator pattern
The observer pattern
The strategy pattern
The state pattern
The singleton pattern
The template pattern
Chapter 11. Python Design Patterns II
The adapter pattern
The facade pattern