Skip to main content
main-content
Top

About this book

You’ve learned the basics of Python, but how do you take your skills to the next stage? Even if you know enough to be productive, there are a number of features that can take you to the next level in Python. Pro Python, Second Edition explores concepts and features normally left to experimentation, allowing you to be even more productive and creative.

In addition to pure code concerns, Pro Python develops your programming techniques and approaches, which will help make you a better Python programmer. This book will improve not only your code but also your understanding and interaction with the many established Python communities.

This book takes your Python knowledge and coding skills to the next level. It shows you how to write clean, innovative code that will be respected by your peers. With this book, make your code do more with introspection and meta-programming. And learn and later use the nuts and bolts of an application, tier-by-tier as a complex case study along the way.

For more information, including a link to the source code referenced in the book, please visit http://propython.com/.

Table of Contents

Chapter 2. Advanced Basics

Abstract
Like any other book on programming, the remainder of this book relies on quite a few features that may or may not be considered commonplace by readers. You, the reader, are expected to know a good deal about Python and programming in general, but there are a variety of lesser-used features that are extremely useful in the operations of many techniques shown throughout the book.
J. Burton Browning, Marty Alchin

Chapter 4. Classes

Abstract
In Chapter 3 you reviewed how functions allow you to define code that can be reused. This allowed for general code streamlining by not having to retype "chuncks" of code. However, it’s often more useful to combine those same functions into logical groupings that define the behavior and attributes of a particular type of object. This is standard object-oriented (OO) programming, which is implemented in Python by way of types and classes. These, like functions, may seem simple enough on the surface, but there’s a considerable amount of power behind them that you can leverage.
J. Burton Browning, Marty Alchin

Chapter 6. Object Management

Abstract
Creating an instance of a class is only the beginning; once you have an object, there are a number of things you can do with it. This is obvious, of course, because objects have methods and attributes that are intended to control their behavior, but those are defined by each class. Objects, as a whole, have an additional set of features that allow you to manage them in a number of different ways.
J. Burton Browning, Marty Alchin

Chapter 7. Strings

Abstract
Given the fundamental nature of strings in all forms of programming, it should come as no surprise that Python’s string features can fill an entire chapter. Whether it’s interacting with users by way of keyboard input, sending content over the Web, analyzing the great American novel, or participating in a Turing test, strings can and are used for many applications.
J. Burton Browning, Marty Alchin

Chapter 9. Testing

Abstract
Writing an application is only part of the process; it’s also important to check that all of the code works as it should. You can visually inspect the code, but it’s better to execute it in a variety of situations that may arise in the real world to make sure it behaves properly in all situations. This process is called unit testing because the goal is to test the smallest available units of execution.
J. Burton Browning, Marty Alchin

Chapter 10. Distribution

Abstract
Once you have a working application, the next step is to decide how and where to distribute it. You might be writing it for yourself, but most likely you will have a wider audience and have a set schedule for releasing it. There are a number of decisions to be made and tasks to be performed before you can do that, however. This process consists primarily of packaging and distribution, but it begins with licensing.
J. Burton Browning, Marty Alchin

Chapter 11. Sheets: A CSV Framework

Abstract
Of course, the most important thing in programming is the program. Tools, techniques, philosophy, and advice don’t offer much at all if they’re never applied to solve a real-world problem. Sometimes that problem is very specific, but other times it’s merely a specific example of a more general problem. These general problems are typically the subject of libraries and frameworks, which can provide the base for a more specific application.
J. Burton Browning, Marty Alchin

Appendix B. Voting Guidelines

Abstract
Author: Barry Warsaw
J. Burton Browning, Marty Alchin

Appendix C. The Zen of Python

Abstract
Author: Tim Peters
J. Burton Browning, Marty Alchin

Appendix D. Docstring Conventions

Abstract
Authors: David Goodger, Guido van Rossum
J. Burton Browning, Marty Alchin

Appendix G. Python Language Moratorium

Abstract
Authors of this PEP: Brett Cannon, Jesse Noller, Guido van Rossum
J. Burton Browning, Marty Alchin
Additional information