gitmyhub

example-code

Python ★ 5.6k updated 4y ago ▣ archived

Example code for the book Fluent Python, 1st Edition (O'Reilly, 2015)

Code examples from the first edition of Fluent Python, an O'Reilly book on idiomatic Python for developers who already know the basics. Archived, second-edition code lives in example-code-2e.

Pythonsetup: easycomplexity 1/5

This repository contains the example code that accompanied the first edition of the book Fluent Python by Luciano Ramalho, published by O Reilly in 2015. The book is a deep guide to idiomatic Python, covering how to write code that takes full advantage of what the language offers rather than just translating habits from other programming languages. It is aimed at developers who already know the basics of Python and want to understand it more thoroughly.

The repository is archived and no longer updated. The code it contains corresponds to the first edition only. A second edition of the book was later published, and its example code lives in a separate repository at github.com/fluentpython/example-code-2e, which is the current maintained version. Anyone working through the second edition should use that repository instead.

The README includes a note that during the original writing process, code may have changed or disappeared without warning, and that some pieces not yet in the published ebook at any given time might have been broken. It was a working scratch space during book production, not a polished permanent reference. For readers of the first edition today, the code here may still be a useful companion, but the archived status means issues and inconsistencies are not being fixed.

The code itself is organized to match the book chapters, which cover topics like Python data structures, functions treated as objects, object-oriented design idioms, iterators and generators, concurrency, and metaprogramming. No setup beyond a standard Python installation is required to run most examples.

Where it fits