PacktLib: Expert Python Programming

Credits

Foreword

About the Author

About the Reviewers

Preface

Getting started

Installing Python

The Python Prompt

Installing setuptools

Working Environment

Summary

Syntax Best Practices—Below the Class Level

List Comprehensions

Iterators and Generators

Decorators

with and contextlib

Summary

Syntax Best Practices—Above the Class Level

Subclassing Built-in Types

Accessing Methods from Superclasses

Best Practices

Descriptors and Properties

Slots

Meta-programming

Summary

Choosing Good Names

PEP 8 and Naming Best Practices

Naming Styles

Naming Guide

Best Practices for Arguments

Class Names

Module and Package Names

Working on APIs

Useful Tools

Summary

Writing a Package

A Common Pattern for All Packages

The Template-Based Approach

Creating the Package Template

Development Cycle

Summary

Writing an Application

Atomisator: An Introduction

Overall Picture

Working Environment

Writing the Packages

Distributing Atomisator

Dependencies between Packages

Summary

Working with zc.buildout

zc.buildout Philosophy

Releasing and Distributing

Summary

Managing Code

Version Control Systems

Continuous Integration

Summary

Managing Life Cycle

Different Approaches

Defining a Life Cycle

Setting Up a Tracking System

Summary

Documenting Your Project

The Seven Rules of Technical Writing

A reStructuredText Primer

Building the Documentation

Make Your Own Portfolio

Summary

Test-Driven Development

I Don't Test

I Do Test

Summary

Optimization: General Principles and Profiling Techniques

The Three Rules of Optimization

Optimization Strategy

Finding Bottlenecks

Summary

Optimization: Solutions

Reducing the Complexity

Multithreading

Multiprocessing

Caching

Summary

Useful Design Patterns

Creational Patterns

Structural Patterns

Behavioral Patterns

Summary

Index