Skip to content

Commit 2e84544

Browse files
committed
Merge branch 'master' of github.com:fluentpython/example-code-2e
2 parents 434f8d2 + a40bd03 commit 2e84544

File tree

5 files changed

+39
-35
lines changed

5 files changed

+39
-35
lines changed

README.md

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,45 @@
11
# Fluent Python 2e example code
22

3-
Example code for the book **Fluent Python, 2<sup>nd</sup> edition** by Luciano Ramalho (O'Reilly, 2021).
3+
Example code for the book **Fluent Python, Second Edition** by Luciano Ramalho (O'Reilly, 2022).
44

5-
> **BEWARE**: This is a work in progress!
6-
>
7-
> * Code here may change and disappear without warning.
8-
>
9-
> * Major reorganizations may happen at any time.
10-
>
11-
> * No promises. No guarantees. Use at own risk.
125

136
## Table of Contents
147

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

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

19-
🚨 This table of contents is subject to change at any time until the book goes to the printer.
12+
> 🚨 &nbsp;This table of contents is subject to change at any time until the book goes to the printer.<BR>
13+
Latest change: Old **Part I—Prologue** merged into new **Part I—Data Structures**; parts renumbered accordingly; chapter numbers unchanged.
2014

2115
Part / Chapter #|Title|Directory|1<sup>st</sup> ed. Chapter&nbsp;#
2216
---:|---|---|:---:
23-
**I – Prologue**|
17+
**I – Data Structures**|
2418
1|The Python Data Model|[01-data-model](01-data-model)|1
25-
**II – Data Structures**|
2619
2|An Array of Sequences|[02-array-seq](02-array-seq)|2
2720
3|Dictionaries and Sets|[03-dict-set](03-dict-set)|3
2821
4|Unicode Text versus Bytes|[04-text-byte](04-text-byte)|4
2922
5|Data Class Builders|[05-data-classes](05-data-classes)|🆕
3023
6|Object References, Mutability, and Recycling|[06-obj-ref](06-obj-ref)|8
31-
**III – Functions as Objects**|
24+
**II – Functions as Objects**|
3225
7|Funcions as First-Class Objects|[07-1class-func](07-1class-func)|5
33-
8|Type Hints in Function Definitions|[08-def-type-hints](08-def-type-hints)|🆕
34-
9|Function Decorators and Closures|[09-closure-deco](09-closure-deco)|7
26+
8|Type Hints in Functions|[08-def-type-hints](08-def-type-hints)|🆕
27+
9|Decorators and Closures|[09-closure-deco](09-closure-deco)|7
3528
10|Design Patterns with First-Class Functions|[10-dp-1class-func](10-dp-1class-func)|6
36-
**IV – Object-Oriented Idioms**|
29+
**III – Object-Oriented Idioms**|
3730
11|A Pythonic Object|[11-pythonic-obj](11-pythonic-obj)|9
38-
12|Sequence Hacking, Hashing, and Slicing|[12-seq-hacking](12-seq-hacking)|10
31+
12|Special Methods for Sequences|[12-seq-hacking](12-seq-hacking)|10
3932
13|Interfaces, Protocols, and ABCs|[13-protocl-abc](13-protocol-abc)|11
40-
14|Inheritance: For Good or For Worse|[14-inheritance](14-inheritance)|12
33+
14|Inheritance: For Better or For Worse|[14-inheritance](14-inheritance)|12
4134
15|More About Type Hints|[15-more-types](15-more-types)|🆕
42-
16|Operator Overloading: Doing It Right|[16-op-overloading](16-op-overloading)|13
43-
**V – Control Flow**|
35+
16|Operator Overloading|[16-op-overloading](16-op-overloading)|13
36+
**IV – Control Flow**|
4437
17|Iterators, Generators, and Classic Coroutines|[17-it-generator](17-it-generator)|14
45-
18|Context Managers and else Blocks|[18-with-match](18-with-match)|15
38+
18|with, match, and else Blocks|[18-with-match](18-with-match)|15
4639
19|Concurrency Models in Python|[19-concurrency](19-concurrency)|🆕
4740
20|Concurrent Executors|[20-executors](20-executors)|17
4841
21|Asynchronous Programming|[21-async](21-async)|18
49-
**VI – Metaprogramming**|
42+
**V – Metaprogramming**|
5043
22|Dynamic Attributes and Properties|[22-dyn-attr-prop](22-dyn-attr-prop)|19
5144
23|Attribute Descriptors|[23-descriptor](23-descriptor)|20
5245
24|Class Metaprogramming|[24-class-metaprog](24-class-metaprog)|21

links/FPY.LI.htaccess

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
ErrorDocument 404 /404.html
22

33
# main resources
4+
RedirectTemp /book https://www.oreilly.com/library/view/fluent-python-2nd/9781492056348/
45
RedirectTemp /code https://github.com/fluentpython/example-code-2e
56
RedirectTemp /home https://www.fluentpython.com/
67

78
# URLs mentioned at least three times
89
RedirectTemp /bisect https://www.fluentpython.com/extra/ordered-sequences-with-bisect/
9-
RedirectTemp /cardxvi https://www.python.org/dev/peps/pep-0484/#the-numeric-tower
10+
RedirectTemp /cardxvi https://www.python.org/dev/peps/pep-0484/#the-numeric-tower
1011
RedirectTemp /collec https://docs.python.org/3/library/collections.html
1112
RedirectTemp /dask https://dask.org/
1213
RedirectTemp /dtmodel https://docs.python.org/3/reference/datamodel.html
1314
RedirectTemp /descr101 https://www.python.org/download/releases/2.2.3/descrintro/
1415
RedirectTemp /descrhow https://docs.python.org/3/howto/descriptor.html
1516
RedirectTemp /doctest https://docs.python.org/3/library/doctest.html
16-
RedirectTemp /effectpy https://effectivepython.com/
17+
RedirectTemp /effectpy https://effectivepython.com/
1718
RedirectTemp /fmtspec https://docs.python.org/3/library/string.html#formatspec
1819
RedirectTemp /gunicorn https://gunicorn.org/
1920
RedirectTemp /hashint https://www.fluentpython.com/extra/internals-of-sets-and-dicts/
@@ -25,16 +26,18 @@ RedirectTemp /norvigdp http://norvig.com/design-patterns/
2526
RedirectTemp /nsphere https://en.wikipedia.org/wiki/N-sphere
2627
RedirectTemp /oldcoro https://www.fluentpython.com/extra/classic-coroutines/
2728
RedirectTemp /pandas https://pandas.pydata.org/
28-
RedirectTemp /pycook3 https://www.oreilly.com/library/view/python-cookbook-3rd/9781449357337/
29-
RedirectTemp /pynut3 https://www.oreilly.com/library/view/python-in-a/9781491913833/
29+
RedirectTemp /pycook3 https://www.oreilly.com/library/view/python-cookbook-3rd/9781449357337/
30+
RedirectTemp /pynut3 https://www.oreilly.com/library/view/python-in-a/9781491913833/
3031
RedirectTemp /pypydif https://doc.pypy.org/en/latest/cpython_differences.html#subclasses-of-built-in-types
3132
RedirectTemp /shed4051 https://github.com/python/typeshed/issues/4051
32-
RedirectTemp /slatkin https://effectivepython.com/
3333
RedirectTemp /specattr https://docs.python.org/3/library/stdtypes.html#special-attributes
34-
RedirectTemp /typecoro https://docs.python.org/3.10/library/typing.html#typing.Coroutine
34+
RedirectTemp /typecoro https://docs.python.org/3.10/library/typing.html#typing.Coroutine
3535
RedirectTemp /typing https://docs.python.org/3/library/typing.html
3636
RedirectTemp /weakref https://www.fluentpython.com/extra/weak-references/
3737

38+
# URL added during QA of the Second Edition
39+
RedirectTemp /bdfl https://www.artima.com/weblogs/viewpost.jsp?thread=235725
40+
3841
# Python Enhancement Proposals
3942
RedirectTemp /pep218 https://www.python.org/dev/peps/pep-0218/
4043
RedirectTemp /pep227 https://www.python.org/dev/peps/pep-0227/
@@ -149,7 +152,7 @@ RedirectTemp /a-18 https://www.python.org/doc/essays/
149152
RedirectTemp /1-1 http://hugunin.net/story_of_jython.html
150153
RedirectTemp /1-2 https://www.oreilly.com/library/view/jython-essentials/9781449397364/
151154
RedirectTemp /1-3 https://docs.python.org/3/reference/lexical_analysis.html#reserved-classes-of-identifiers
152-
RedirectTemp /1-4 https://docs.python.org/2/library/string.html#format-string-syntax
155+
RedirectTemp /1-4 https://docs.python.org/3.10/library/string.html#format-string-syntax
153156
RedirectTemp /1-5 https://stackoverflow.com/questions/1436703/what-is-the-difference-between-str-and-repr
154157
RedirectTemp /1-6 https://docs.python.org/3/library/stdtypes.html#truth
155158
RedirectTemp /1-7 https://docs.python.org/3/tutorial/controlflow.html#unpacking-argument-lists

links/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ I replaced almost all URLs in the book with shortened versions that go through t
1212
The site has an `.htaccess` file with *temporary* redirects.
1313

1414
When I find out a link is stale, I can thange the redirect in `.htaccess` to a new target,
15-
so the link in the book is back in service through the updated redirect.
15+
which may be a link to copy in the Internet Archive's
16+
[Wayback Machine](https://archive.org/web/)
17+
o the link in the book is back in service through the updated redirect.
18+
1619

1720
## Help wanted
1821

links/custom.htaccess

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
ErrorDocument 404 /404.html
22

33
# main resources
4+
RedirectTemp /book https://www.oreilly.com/library/view/fluent-python-2nd/9781492056348/
45
RedirectTemp /code https://github.com/fluentpython/example-code-2e
56
RedirectTemp /home https://www.fluentpython.com/
67

78
# URLs mentioned at least three times
89
RedirectTemp /bisect https://www.fluentpython.com/extra/ordered-sequences-with-bisect/
9-
RedirectTemp /cardxvi https://www.python.org/dev/peps/pep-0484/#the-numeric-tower
10+
RedirectTemp /cardxvi https://www.python.org/dev/peps/pep-0484/#the-numeric-tower
1011
RedirectTemp /collec https://docs.python.org/3/library/collections.html
1112
RedirectTemp /dask https://dask.org/
1213
RedirectTemp /dtmodel https://docs.python.org/3/reference/datamodel.html
1314
RedirectTemp /descr101 https://www.python.org/download/releases/2.2.3/descrintro/
1415
RedirectTemp /descrhow https://docs.python.org/3/howto/descriptor.html
1516
RedirectTemp /doctest https://docs.python.org/3/library/doctest.html
16-
RedirectTemp /effectpy https://effectivepython.com/
17+
RedirectTemp /effectpy https://effectivepython.com/
1718
RedirectTemp /fmtspec https://docs.python.org/3/library/string.html#formatspec
1819
RedirectTemp /gunicorn https://gunicorn.org/
1920
RedirectTemp /hashint https://www.fluentpython.com/extra/internals-of-sets-and-dicts/
@@ -25,16 +26,18 @@ RedirectTemp /norvigdp http://norvig.com/design-patterns/
2526
RedirectTemp /nsphere https://en.wikipedia.org/wiki/N-sphere
2627
RedirectTemp /oldcoro https://www.fluentpython.com/extra/classic-coroutines/
2728
RedirectTemp /pandas https://pandas.pydata.org/
28-
RedirectTemp /pycook3 https://www.oreilly.com/library/view/python-cookbook-3rd/9781449357337/
29-
RedirectTemp /pynut3 https://www.oreilly.com/library/view/python-in-a/9781491913833/
29+
RedirectTemp /pycook3 https://www.oreilly.com/library/view/python-cookbook-3rd/9781449357337/
30+
RedirectTemp /pynut3 https://www.oreilly.com/library/view/python-in-a/9781491913833/
3031
RedirectTemp /pypydif https://doc.pypy.org/en/latest/cpython_differences.html#subclasses-of-built-in-types
3132
RedirectTemp /shed4051 https://github.com/python/typeshed/issues/4051
32-
RedirectTemp /slatkin https://effectivepython.com/
3333
RedirectTemp /specattr https://docs.python.org/3/library/stdtypes.html#special-attributes
34-
RedirectTemp /typecoro https://docs.python.org/3.10/library/typing.html#typing.Coroutine
34+
RedirectTemp /typecoro https://docs.python.org/3.10/library/typing.html#typing.Coroutine
3535
RedirectTemp /typing https://docs.python.org/3/library/typing.html
3636
RedirectTemp /weakref https://www.fluentpython.com/extra/weak-references/
3737

38+
# URL added during QA of the Second Edition
39+
RedirectTemp /bdfl https://www.artima.com/weblogs/viewpost.jsp?thread=235725
40+
3841
# Python Enhancement Proposals
3942
RedirectTemp /pep218 https://www.python.org/dev/peps/pep-0218/
4043
RedirectTemp /pep227 https://www.python.org/dev/peps/pep-0227/

links/deploy.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
scp FPY.LI.htaccess [email protected]:~/fpy.li/.htaccess

0 commit comments

Comments
 (0)