- Python 3 Object Oriented Programming
- Dusty Phillips
- 508字
- 2021-08-03 15:36:03
What this book covers
Chapter 1, Object-oriented Design covers important object-oriented concepts. It deals mainly with abstraction, classes, encapsulation, and inheritance. We also briefly look into UML to model our classes and objects.
Chapter 2, Objects in Python discusses classes and objects and how they are used in Python. We will learn about attributes and behaviors in Python objects, and also the organization of classes into packages and modules. And lastly we shall see how to protect our data.
Chapter 3, When Objects are Alike gives us a more in-depth look into inheritance. It covers multiple inheritance and shows us how to inherit from built-ins. This chapter also covers polymorphism and duck typing.
Chapter 4, Expecting the Unexpected looks into exceptions and exception handling. We shall learn how to create our own exceptions. It also deals with the use of exceptions for program flow control.
Chapter 5, When to Use Object-oriented Programming deals with objects; when to create and use them. We will see how to wrap data using properties, and restricting data access. This chapter also discusses the DRY principle and how not to repeat code.
Chapter 6, Python Data Structures covers object-oriented features of data structures. This chapter mainly deals with tuples, dictionaries, lists, and sets. We will also see how to extend built-in objects.
Chapter 7, Python Object-oriented Shortcuts as the name suggests, deals with little time-savers in Python. We shall look at many useful built-in functions, then move on to using comprehensions in lists, sets, and dictionaries. We will learn about generators, method overloading, and default arguments. We shall also see how to use functions as objects.
Chapter 8, Python Design Patterns I first introduces us to Python design patterns. We shall then see the decorator pattern, observer pattern, strategy pattern, state pattern, singleton pattern, and template pattern. These patterns are discussed with suitable examples and programs implemented in Python.
Chapter 9, Python Design Patterns II picks up where the previous chapter left us. We shall see the adapter pattern, facade pattern, flyweight pattern, command pattern, abstract pattern, and composite pattern with suitable examples in Python.
Chapter 10, Files and Strings looks at strings and string formatting. Bytes and byte arrays are also discussed. We shall also look at files, and how to write and read data to and from files. We shall look at ways to store and pickle objects, and finally the chapter discusses serializing objects.
Chapter 11, Testing Object-oriented Programs opens with the use of testing and why testing is so important. It focuses on test-driven development. We shall see how to use the unittest
module, and also the py.test
automated testing suite. Lastly we shall cover code coverage using coverage.py
.
Chapter 12, Common Python 3 Libraries concentrates on libraries and their utilization in application building. We shall build databases using SQLAlchemy, and user interfaces TkInter and PyQt. The chapter goes on to discuss how to construct XML documents and we shall see how to use ElementTree and lxml. Lastly we will use CherryPy and Jinja to create a web application.