Skip to content

Latest commit

 

History

History
253 lines (128 loc) · 3.08 KB

Pro Python.md

File metadata and controls

253 lines (128 loc) · 3.08 KB

Pro Python, 2e

by Marty Alchin, J. Burton Browning, December 2014 (Apress)

Explores the most advanced features of Python programming through introspection, metaprogramming, object management, package distribution, etc.


Introduction

1. Principles and Philosophy

The Zen of Python

Don't Repeat Yourself

Loose Coupling

The Samurai Principle

The Pareto Principle

The Robustness Principle

Backward Compatibility

The Road to Python 3.0

Taking It With You

2. Advanced Basics

General Concepts

Control Flow

Iteration

Collections

Importing Code

Taking It With You

3. Functions

Arguments

Decorators

Function Annotations

Generators

Lambdas

Introspection

Taking It With You

4. Classes

Inheritance

How Classes Are Created

Attributes

Methods

Magic Methods

Taking It With You

5. Common Protocols

Basic Operations

Numbers

Iterables

Sequences

Mappings

Callables

Context Managers

Taking It With You

6. Object Management

Namespace Dictionary

Garbage Collection

Pickling

Copying

Taking It With You

7. Strings

Bytes

Text

Simple Substitution

Formatting

Taking It With You

8. Documentation

Proper Naming

Comments

Docstrings

Documentation Outside the Code

Documentation Utilities

Taking It With You

9. Testing

Test-Driven Development

Doctests

The unittest Module

Providing a Custom Test Class

Taking It With You

10. Distribution

Licensing

Packaging

Distribution

Taking It With You

11. Sheets: A CSV Framework

Building a Declarative Framework

Building the Framework

Ordering Fields

Building a Field Library

Getting Back to CSV

Taking It With You

Appendix A: Style Guide for Python

Introduction

A Foolish Consistency Is the Hobgoblin of Little Minds

Code Layout

Imports

Whitespace in Expressions and Statements

Comments

Documentation Strings

Version Bookkeeping

Naming Conventions

Programming Recommendations

Appendix B: Voting Guidelines

Abstract

Rationale

Voting Scores

Appendix C: The Zen of Python

Abstract

The Zen of Python

Easter Egg

Appendix D: Docstring Conventions

Abstract

Rationale

Specification

Appendix E: Backward Compatibility Policy

Abstract

Rationale

Backward Compatibility Rules

Making Incompatible Changes

Appendix F: Python 3000

Abstract

Naming

PEP Numbering

Timeline

Compatibility and Transition

Implementation Language

Meta-Contributions

Appendix G: Python Language Moratorium

Abstract

Rationale

Details

Retroactive

Extensions