MCPcopy
hub / github.com/fluentpython/example-code-2e

github.com/fluentpython/example-code-2e @2.0b sqlite

repository ↗ · DeepWiki ↗ · release 2.0b ↗
2,616 symbols 6,905 edges 410 files 425 documented · 16%
README

Fluent Python 2e example code

Example code for the book Fluent Python, 2nd edition by Luciano Ramalho (O'Reilly, 2021).

BEWARE: This is a work in progress!

  • Code here may change and disappear without warning.

  • Major reorganizations may happen at any time.

  • No promises. No guarantees. Use at own risk.

Table of Contents

All chapters are undergoing review and updates, including significant rewrites in the chapters about concurrency in Part V.

New chapters in Fluent Python 2e are marked with 🆕.

🚨 This table of contents is subject to change at any time until the book goes to the printer.

Part / Chapter # Title Directory 1st ed. Chapter #
I – Prologue
1 The Python Data Model 01-data-model 1
II – Data Structures
2 An Array of Sequences 02-array-seq 2
3 Dictionaries and Sets 03-dict-set 3
4 Unicode Text versus Bytes 04-text-byte 4
5 Data Class Builders 05-data-classes 🆕
6 Object References, Mutability, and Recycling 06-obj-ref 8
III – Functions as Objects
7 Funcions as First-Class Objects 07-1class-func 5
8 Type Hints in Function Definitions 08-def-type-hints 🆕
9 Function Decorators and Closures 09-closure-deco 7
10 Design Patterns with First-Class Functions 10-dp-1class-func 6
IV – Object-Oriented Idioms
11 A Pythonic Object 11-pythonic-obj 9
12 Sequence Hacking, Hashing, and Slicing 12-seq-hacking 10
13 Interfaces, Protocols, and ABCs 13-protocl-abc 11
14 Inheritance: For Good or For Worse 14-inheritance 12
15 More About Type Hints 15-more-types 🆕
16 Operator Overloading: Doing It Right 16-op-overloading 13
V – Control Flow
17 Iterators, Generators, and Classic Coroutines 17-it-generator 14
18 Context Managers and else Blocks 18-with-match 15
19 Concurrency Models in Python 19-concurrency 🆕
20 Concurrent Executors 20-executors 17
21 Asynchronous Programming 21-async 18
VI – Metaprogramming
22 Dynamic Attributes and Properties 22-dyn-attr-prop 19
23 Attribute Descriptors 23-descriptor 20
24 Class Metaprogramming 24-class-metaprog 21

Core symbols most depended-on inside this repo

append
called by 87
21-async/mojifinder/bottle.py
get
called by 69
21-async/mojifinder/bottle.py
replace
called by 51
21-async/mojifinder/bottle.py
items
called by 49
21-async/mojifinder/bottle.py
update
called by 43
21-async/mojifinder/bottle.py
pop
called by 42
03-dict-set/transformdict.py
fetch
called by 30
22-dyn-attr-prop/oscon/schedule_v3.py
total
called by 27
10-dp-1class-func/strategy.py

Shape

Method 1,143
Function 905
Class 558
Route 10

Languages

Python100%
Java1%

Modules by API surface

21-async/mojifinder/bottle.py407 symbols
17-it-generator/tree/classtree/classtree_test.py37 symbols
18-with-match/lispy/original/lispy.py29 symbols
17-it-generator/tree/extra/test_drawtree.py28 symbols
17-it-generator/tree/step6/test_tree.py25 symbols
17-it-generator/tree/step5/test_tree.py25 symbols
17-it-generator/tree/extra/test_tree.py25 symbols
16-op-overloading/vector_v7.py25 symbols
17-it-generator/tree/step4/test_tree.py23 symbols
16-op-overloading/vector_v8.py23 symbols
17-it-generator/isis2json/iso2709.py21 symbols
16-op-overloading/vector_v6.py21 symbols

Dependencies from manifests, versioned

anyio3.3.2 · 1×
certifi2021.5.30 · 1×
charset-normalizer2.0.6 · 1×
click7.1.2 · 1×
curio1.5 · 1×
fastapi0.65.2 · 1×
future0.18.2 · 1×
geolib1.0.7 · 1×
h110.12.0 · 1×
httpcore0.13.7 · 1×
httpx1.0.0b0 · 1×
idna3.2 · 1×

For agents

$ claude mcp add example-code-2e \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact