I will be taking a look at Python 3 Object Oriented Programming by Dusty Phillips this time. I tend to think that I'm fairly proficient with the OOP concepts yet I decided to delve into the book just to enforce my thinking and learn a bit about specifics of Python 3. I think the book managed to do this more than well.
Instead of doing traditional good/bad/ugly type of review I will take a look at the book chapter by chapter and finally recap the main findings in verdict.
Thoughts on Chapters
The book contains both theory and practical examples in form of case studies. In addition it provides some ideas for exercises. I find this sort of approach particularly fitting for this type of book. It makes it possible to refer to a specific example later on without too much hassle as the examples provided are complete by themselves.The first chapter explains the basic concepts of OOP. This chapter is particularly valuable for those who haven't dealt with OOP before and provides a nice refresher for those already familiar with it. It might have been nice to have a little bit of history (Smalltalk, Simula) and related paradigms (AOP, traits) covered or at least mentioned, though.
The second chapter builds upon the first and shows how to use OOP concepts in Python. In addition it deals with Python modules and packages. Again if you have dealt with these issues before there probably isn't anything surprising here. You might still pick a trick or two, though. In case you are interested you can find the chapter in its entirety here in an article format.
The third chapter shows various ways to organize code and discusses several concepts explained in the first chapter in practice. Particularly multiple inheritance and problems related to it are covered well.
The fourth chapter deals with exceptions. It shows well when to use them and when not to. All in all a fine chapter.
The fifth chapter focuses on showing when and how to use OOP in practice. It covers some nice features such as decorators and properties. You can find the content of the chapter in these two articles: [1] [2].
The sixth chapter discusses basic data structures provided with Python and shows how to extend them. Python provides many useful structures by default and this chapter definitely makes sure you can get the most out of them.
The seventh chapter explains various built-in functions and their usage. In addition other shortcuts, such as comprehensions, generators and variadic functions, are covered. You can find the chapter in pdf format here.
The eight and ninth chapters focus on design patterns. They show how to implement common patterns (decorator, observer, adapter, facade, etc.) in Python. I liked particularly the way the author adapted them to use specific functionality provided by Python. As it happens often the pattern you want to use has been pretty much built into the language itself and you don't have to be as verbose as you might have to be in some other languages.
The tenth chapter deals with files and strings. I appreciated especially the way the author covered strings as they have changed a bit in Python 3 as compared to version 2. There were also some good points on context managers and serialization.
The eleventh chapter takes a decent look at testing. Besides the standard unittest module provided with Python it shows how to use one of my favorite testing tools, py.test. In addition it covers code coverage. Even though the chapter is relatively short I believe it manages to explain the bare essentials of testing.
The twelfth chapter provides a sneak peek at various common libraries (database, ui, web, xml) usable with Python 3. The peeks are quite limited but still manage to provide some food for thought. I think it's a fitting last chapter for the book.
You can find full table of contents here for some additional details.