Follow along with the first edition of Fluent Python by running example code chapter by chapter
Study Python idioms like generators, decorators, and data model methods through working code
Explore how Python treats functions as first-class objects with concrete runnable examples
Use as a companion when reading the first edition to test and modify examples hands-on
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.
← fluentpython on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.