BruceEckel/ThinkingInPython

Fluency, Types, and Design

226

stars

154

commits

Python

primary language

Sep 7, 2026

updated

bruceeckel.github.io/ThinkingInPython

README

Thinking in Python

Fluency, Types, and Design

A python coiled into an infinity sign, swallowing its own tail

Bruce Eckel

An intermediate-to-advanced book for experienced programmers. Includes a fast introduction for programmers from other languages.

Read the Book Online

ThinkingInPython.com

Download the Book

The latest release, rebuilt from the current book source:

All versions are on the releases page.

Setup

  1. Clone this repository.
  2. You need a make command. This is preinstalled on Linux and macOS (macOS: install Xcode Command Line Tools if it's missing). For Windows: winget install ezwinports.make
  3. Install uv.
  4. Run uv sync once. This creates .venv and installs the pinned Python (3.15+) and dev tools automatically. No manual Python install is needed.
  5. Run make tools-check to verify that the essential tools are available.

Type make to see the options.

These are optional, but if you want to run make site, make local, and make serve, you also need pandoc on your PATH. make prose needs the standalone vale binary. See tools/README for details and install links.


History

I started this book in 2008 and after a few years it kind of drifted to a stop. I think part of the problem was that I wanted to move the design patterns work I had done in Java into Python and even then I was beginning to become uncertain about OOP (The material is still there, translated, but it is preceded by a chapter explaining my OOP misgivings).

I had forgotten about this book but (especially at Pycons) people would occasionally come up to me and mention that they had gotten some value out of it. Because of the condition of the book, which still had a number of examples that were still in Java (!), I found this embarrassing.

In June 2026 I decided to see what the Claude AI could do with it, and in short order it had brought everything up to Python 3.15, with type annotations, passing standards checkers, cleaning up prose, etc. I began going back through my Pycon presentations and blog posts and adding those. At the moment it is in decent shape and you can read it online: https://bruceeckel.github.io/ThinkingInPython/


Edit checklist

Post-AI edit (Began August 12, 2026)

After doing everything I could think of to do with AI. My current strategy is to edit a chapter, ask AI to derive guidelines from my edits, then AI-apply those guidelines throughout the book before editing the next chapter. Hypothetically this will produce asymptotically-decreasing edits as I proceed through the book.

Note that I am not starting at the beginning, but picking up where I left off during the "Serious Edit."

ChapterEdited
01_Introduction.md
02_Tour.md
03_Containers.md
04_Control_Flow.md
05_Functions.md
06_Modules_and_Packages.md
07_Classes.md
08_Static_Typing.md
09_Class_Attributes.md
10_Cleanup.md
11_Testing.md
12_Data_Classes_as_Types.md
13_Pattern_Matching.md
14_Decorators.md
15_Context_Managers.md
16_Comprehensions.md
17_Metaprogramming.md
18_Performance.md
19_Concurrency.md
20_Rethinking_Objects.md
21_The_Pattern_Concept.md
22_Data_Transfer_Objects.md
23_Iterators.md
24_Singleton.md
25_Template_Method.mdO
26_Surrogate.md
27_Factory.md
28_Function_Objects.md
29_Changing_the_Interface.md
30_Observer.md
31_State_Machines.md
32_Multiple_Dispatching.md
33_Visitor.md
34_Composite_and_Interpreter.md
35_Flyweight.md
36_Memento.md
37_Pattern_Refactoring.md
38_Simulation.md
39_Pattern_Catalog.md
40_Functional_Foundations.md
41_Functional_Toolkits.md
42_Functional_Error_Handling.md
43_Functional_Assurance.md
44_Effect_Management.md
45_Generators.md
46_Stateless.md
47_Stateless_in_Practice.md

Serious Edit

The first serious edit pass.

ChapterEdited
01_Introduction.mdX
02_Tour.mdX
03_Containers.mdX
04_Control_Flow.mdX
05_Functions.mdX
06_Modules_and_Packages.mdX
07_Classes.mdX
08_Static_Typing.mdX
09_Class_Attributes.mdX
10_Cleanup.mdX
11_Testing.mdX
12_Data_Classes_as_Types.mdX
13_Pattern_Matching.mdX
14_Decorators.mdX
15_Context_Managers.mdX
16_Comprehensions.mdX
17_Metaprogramming.mdX
18_Performance.mdX
19_Concurrency.mdX
20_Rethinking_Objects.mdX
21_The_Pattern_Concept.mdX
22_Data_Transfer_Objects.mdX
23_Iterators.mdX
24_Singleton.mdX
25_Template_Method.md
26_Surrogate.md
27_Factory.md
28_Function_Objects.md
29_Changing_the_Interface.md
30_Observer.md
31_State_Machines.md
32_Multiple_Dispatching.md
33_Visitor.md
34_Composite_and_Interpreter.md
35_Flyweight.md
36_Memento.md
37_Pattern_Refactoring.md
38_Simulation.md
39_Pattern_Catalog.md
40_Functional_Foundations.md
41_Functional_Toolkits.md
42_Functional_Error_Handling.md
43_Functional_Assurance.md
44_Effect_Management.md
45_Generators.md
46_Stateless.mdX
47_Stateless_in_Practice.md

Initial Draft

This draft gets all the chapters and sections in place and ready for a serious edit pass. Two passes: my own edit pass (Edited), then incorporating Claude's review and re-checking (Reviewed).

The 🔴 denotes an unfinished chapter, so expect that to be in greater disarray.

ChapterEditedReviewed
01_Introduction.mdXX
02_Tour.mdXX
03_Containers.mdXX
04_Control_Flow.mdXX
05_Functions.mdXX
06_Modules_and_Packages.mdXX
07_Classes.mdXX
08_Static_Typing.mdXX
09_Class_Attributes.mdXX
10_Cleanup.mdXX
11_Testing.mdXX
12_Data_Classes_as_Types.mdXX
13_Pattern_Matching.mdXX
14_Decorators.mdXX
15_Context_Managers.mdXX
16_Comprehensions.mdXX
17_Metaprogramming.mdXX
18_Performance.mdXX
19_Concurrency.mdXX
20_Rethinking_Objects.mdXX
21_The_Pattern_Concept.mdXX
22_Data_Transfer_Objects.mdXX
23_Iterators.mdXX
24_Singleton.mdXX
25_Template_Method.mdXX
26_Surrogate.mdXX
27_Factory.mdXX
28_Function_Objects.mdXX
29_Changing_the_Interface.mdXX
30_Observer.mdXX
31_State_Machines.mdXX
32_Multiple_Dispatching.mdXX
33_Visitor.mdXX
34_Composite_and_Interpreter.mdXX
35_Flyweight.mdXX
36_Memento.mdXX
37_Pattern_Refactoring.mdXX
38_Simulation.mdXX
39_Pattern_Catalog.mdXX
40_Functional_Foundations.mdXX
41_Functional_Toolkits.mdXX
42_Functional_Error_Handling.mdXX
43_Functional_Assurance.mdXX
44_Effect_Management.md🔴🔴
45_Generators.md🔴🔴
46_Stateless.mdXX
47_Stateless_in_Practice.md🔴🔴

Contributors

BruceEckel

150 commits

jcerise

2 commits

halverdog

1 commits

veganaiZe

1 commits

BruceEckel/ThinkingInPython

Fluency, Types, and Design

226

stars

154

commits

Python

primary language

Sep 7, 2026

updated

bruceeckel.github.io/ThinkingInPython

README

Thinking in Python

Fluency, Types, and Design

A python coiled into an infinity sign, swallowing its own tail

Bruce Eckel

An intermediate-to-advanced book for experienced programmers. Includes a fast introduction for programmers from other languages.

Read the Book Online

ThinkingInPython.com

Download the Book

The latest release, rebuilt from the current book source:

All versions are on the releases page.

Setup

  1. Clone this repository.
  2. You need a make command. This is preinstalled on Linux and macOS (macOS: install Xcode Command Line Tools if it's missing). For Windows: winget install ezwinports.make
  3. Install uv.
  4. Run uv sync once. This creates .venv and installs the pinned Python (3.15+) and dev tools automatically. No manual Python install is needed.
  5. Run make tools-check to verify that the essential tools are available.

Type make to see the options.

These are optional, but if you want to run make site, make local, and make serve, you also need pandoc on your PATH. make prose needs the standalone vale binary. See tools/README for details and install links.


History

I started this book in 2008 and after a few years it kind of drifted to a stop. I think part of the problem was that I wanted to move the design patterns work I had done in Java into Python and even then I was beginning to become uncertain about OOP (The material is still there, translated, but it is preceded by a chapter explaining my OOP misgivings).

I had forgotten about this book but (especially at Pycons) people would occasionally come up to me and mention that they had gotten some value out of it. Because of the condition of the book, which still had a number of examples that were still in Java (!), I found this embarrassing.

In June 2026 I decided to see what the Claude AI could do with it, and in short order it had brought everything up to Python 3.15, with type annotations, passing standards checkers, cleaning up prose, etc. I began going back through my Pycon presentations and blog posts and adding those. At the moment it is in decent shape and you can read it online: https://bruceeckel.github.io/ThinkingInPython/


Edit checklist

Post-AI edit (Began August 12, 2026)

After doing everything I could think of to do with AI. My current strategy is to edit a chapter, ask AI to derive guidelines from my edits, then AI-apply those guidelines throughout the book before editing the next chapter. Hypothetically this will produce asymptotically-decreasing edits as I proceed through the book.

Note that I am not starting at the beginning, but picking up where I left off during the "Serious Edit."

ChapterEdited
01_Introduction.md
02_Tour.md
03_Containers.md
04_Control_Flow.md
05_Functions.md
06_Modules_and_Packages.md
07_Classes.md
08_Static_Typing.md
09_Class_Attributes.md
10_Cleanup.md
11_Testing.md
12_Data_Classes_as_Types.md
13_Pattern_Matching.md
14_Decorators.md
15_Context_Managers.md
16_Comprehensions.md
17_Metaprogramming.md
18_Performance.md
19_Concurrency.md
20_Rethinking_Objects.md
21_The_Pattern_Concept.md
22_Data_Transfer_Objects.md
23_Iterators.md
24_Singleton.md
25_Template_Method.mdO
26_Surrogate.md
27_Factory.md
28_Function_Objects.md
29_Changing_the_Interface.md
30_Observer.md
31_State_Machines.md
32_Multiple_Dispatching.md
33_Visitor.md
34_Composite_and_Interpreter.md
35_Flyweight.md
36_Memento.md
37_Pattern_Refactoring.md
38_Simulation.md
39_Pattern_Catalog.md
40_Functional_Foundations.md
41_Functional_Toolkits.md
42_Functional_Error_Handling.md
43_Functional_Assurance.md
44_Effect_Management.md
45_Generators.md
46_Stateless.md
47_Stateless_in_Practice.md

Serious Edit

The first serious edit pass.

ChapterEdited
01_Introduction.mdX
02_Tour.mdX
03_Containers.mdX
04_Control_Flow.mdX
05_Functions.mdX
06_Modules_and_Packages.mdX
07_Classes.mdX
08_Static_Typing.mdX
09_Class_Attributes.mdX
10_Cleanup.mdX
11_Testing.mdX
12_Data_Classes_as_Types.mdX
13_Pattern_Matching.mdX
14_Decorators.mdX
15_Context_Managers.mdX
16_Comprehensions.mdX
17_Metaprogramming.mdX
18_Performance.mdX
19_Concurrency.mdX
20_Rethinking_Objects.mdX
21_The_Pattern_Concept.mdX
22_Data_Transfer_Objects.mdX
23_Iterators.mdX
24_Singleton.mdX
25_Template_Method.md
26_Surrogate.md
27_Factory.md
28_Function_Objects.md
29_Changing_the_Interface.md
30_Observer.md
31_State_Machines.md
32_Multiple_Dispatching.md
33_Visitor.md
34_Composite_and_Interpreter.md
35_Flyweight.md
36_Memento.md
37_Pattern_Refactoring.md
38_Simulation.md
39_Pattern_Catalog.md
40_Functional_Foundations.md
41_Functional_Toolkits.md
42_Functional_Error_Handling.md
43_Functional_Assurance.md
44_Effect_Management.md
45_Generators.md
46_Stateless.mdX
47_Stateless_in_Practice.md

Initial Draft

This draft gets all the chapters and sections in place and ready for a serious edit pass. Two passes: my own edit pass (Edited), then incorporating Claude's review and re-checking (Reviewed).

The 🔴 denotes an unfinished chapter, so expect that to be in greater disarray.

ChapterEditedReviewed
01_Introduction.mdXX
02_Tour.mdXX
03_Containers.mdXX
04_Control_Flow.mdXX
05_Functions.mdXX
06_Modules_and_Packages.mdXX
07_Classes.mdXX
08_Static_Typing.mdXX
09_Class_Attributes.mdXX
10_Cleanup.mdXX
11_Testing.mdXX
12_Data_Classes_as_Types.mdXX
13_Pattern_Matching.mdXX
14_Decorators.mdXX
15_Context_Managers.mdXX
16_Comprehensions.mdXX
17_Metaprogramming.mdXX
18_Performance.mdXX
19_Concurrency.mdXX
20_Rethinking_Objects.mdXX
21_The_Pattern_Concept.mdXX
22_Data_Transfer_Objects.mdXX
23_Iterators.mdXX
24_Singleton.mdXX
25_Template_Method.mdXX
26_Surrogate.mdXX
27_Factory.mdXX
28_Function_Objects.mdXX
29_Changing_the_Interface.mdXX
30_Observer.mdXX
31_State_Machines.mdXX
32_Multiple_Dispatching.mdXX
33_Visitor.mdXX
34_Composite_and_Interpreter.mdXX
35_Flyweight.mdXX
36_Memento.mdXX
37_Pattern_Refactoring.mdXX
38_Simulation.mdXX
39_Pattern_Catalog.mdXX
40_Functional_Foundations.mdXX
41_Functional_Toolkits.mdXX
42_Functional_Error_Handling.mdXX
43_Functional_Assurance.mdXX
44_Effect_Management.md🔴🔴
45_Generators.md🔴🔴
46_Stateless.mdXX
47_Stateless_in_Practice.md🔴🔴

See what people are saying

Contributors

BruceEckel

150 commits

jcerise

2 commits

halverdog

1 commits

veganaiZe

1 commits

Languages

Python

92.8%

Makefile

4.3%

JavaScript

1.1%