Skip to content

Commit 7d4ce6e

Browse files
committed
cap19-24: encurtando links
1 parent 6f71c91 commit 7d4ce6e

File tree

10 files changed

+196
-116
lines changed

10 files changed

+196
-116
lines changed

links/FPY.LI.htaccess

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,3 +1400,73 @@ RedirectTemp /9z https://docs.python.org/pt-br/3/library/stdtypes.html#typeconte
14001400
RedirectTemp /a2 https://pt.wikipedia.org/wiki/Recursividade_(ci%C3%AAncia_da_computa%C3%A7%C3%A3o)#Fun%C3%A7%C3%B5es_recursivas_em_cauda
14011401
RedirectTemp /a3 https://docs.python.org/3/library/sqlite3.html#using-the-connection-as-a-context-manager
14021402
RedirectTemp /a4 https://docs.python.org/pt-br/3/reference/datamodel.html#with-statement-context-managers
1403+
# cap19: appended 2026-01-09 15:48:37
1404+
RedirectTemp /a5 https://docs.python.org/pt-br/3/library/sys.html#sys.getswitchinterval
1405+
RedirectTemp /a6 https://pt.wikipedia.org/wiki/Chamada_de_sistema
1406+
RedirectTemp /a7 https://docs.python.org/pt-br/3/library/threading.html#
1407+
RedirectTemp /a8 https://docs.python.org/pt-br/3/library/multiprocessing.shared_memory.html
1408+
RedirectTemp /a9 https://docs.python.org/pt-br/3/library/multiprocessing.shared_memory.html#multiprocessing.shared_memory.ShareableList
1409+
RedirectTemp /aa https://docs.python.org/pt-br/3/library/concurrent.futures.html#processpoolexecutor-example
1410+
RedirectTemp /ab https://docs.python.org/pt-br/3/library/queue.html#queue.SimpleQueue.get
1411+
RedirectTemp /ac https://pt.wikipedia.org/wiki/Condi%C3%A7%C3%A3o_de_corrida
1412+
RedirectTemp /ad https://pt.wikipedia.org/wiki/Troca_de_contexto
1413+
RedirectTemp /ae https://docs.python.org/pt-br/3/library/multiprocessing.html#programming-guidelines
1414+
RedirectTemp /af https://docs.python.org/pt-br/3/faq/library.html#can-t-we-get-rid-of-the-global-interpreter-lock
1415+
RedirectTemp /ag https://docs.python.org/pt-br/3/library/sys.html#sys.setswitchinterval
1416+
RedirectTemp /ah https://docs.python.org/pt-br/3/library/multiprocessing.html
1417+
1418+
# cap20: appended 2026-01-09 16:08:51
1419+
RedirectTemp /aj https://docs.python.org/pt-br/3.10/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor
1420+
RedirectTemp /ak https://docs.python.org/pt-br/3/library/concurrent.futures.html#concurrent.futures.as_completed
1421+
RedirectTemp /am https://docs.python.org/pt-br/3/library/concurrent.futures.html
1422+
RedirectTemp /an https://pt.wikipedia.org/wiki/POSIX_Threads
1423+
RedirectTemp /ap https://pt.wikipedia.org/wiki/Aloca%C3%A7%C3%A3o_din%C3%A2mica_de_mem%C3%B3ria_em_C
1424+
1425+
# cap21: appended 2026-01-09 16:10:48
1426+
RedirectTemp /aq https://docs.python.org/pt-br/3/library/asyncio-eventloop.html#asyncio.loop.getaddrinfo
1427+
RedirectTemp /ar https://docs.python.org/pt-br/3/library/socket.html#socket.getaddrinfo
1428+
RedirectTemp /as https://docs.python.org/pt-br/3.10/library/asyncio-eventloop.html#asyncio.get_event_loop
1429+
RedirectTemp /at https://docs.python.org/pt-br/3/library/asyncio-task.html#asyncio.create_task
1430+
RedirectTemp /av https://pt.wikipedia.org/wiki/Armazenamento_conectado_%C3%A0_rede
1431+
RedirectTemp /aw https://pt.wikipedia.org/wiki/Sem%C3%A1foro_(computa%C3%A7%C3%A3o)
1432+
RedirectTemp /ax https://docs.python.org/pt-br/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor
1433+
RedirectTemp /ay https://pt.wikipedia.org/wiki/Disco_de_Festo
1434+
RedirectTemp /az https://pt.wikipedia.org/wiki/Listas_invertidas
1435+
RedirectTemp /b2 https://docs.python.org/pt-br/3/library/asyncio-stream.html#asyncio.start_server
1436+
RedirectTemp /b3 https://docs.python.org/pt-br/3/library/asyncio-eventloop.html#asyncio.Server.serve_forever
1437+
RedirectTemp /b4 https://docs.python.org/pt-br/3/library/asyncio-stream.html#asyncio.StreamWriter.close
1438+
RedirectTemp /b5 https://docs.python.org/pt-br/3/library/asyncio-stream.html#streamwriter
1439+
RedirectTemp /b6 https://docs.python.org/pt-br/3/library/contextlib.html#contextlib.asynccontextmanager
1440+
RedirectTemp /b7 https://docs.python.org/pt-br/3/library/asyncio-task.html#asyncio.gather
1441+
RedirectTemp /b8 https://pt.wikipedia.org/wiki/D%C3%ADvida_tecnol%C3%B3gica
1442+
RedirectTemp /b9 https://docs.python.org/pt-br/3/library/asyncio.html
1443+
RedirectTemp /ba https://docs.python.org/pt-br/3/library/asyncio-dev.html
1444+
RedirectTemp /bb https://docs.python.org/pt-br/3/library/asyncio-protocol.html
1445+
RedirectTemp /bc https://docs.python.org/pt-br/3/library/asyncio-protocol.html#tcp-echo-server
1446+
1447+
# cap22: appended 2026-01-09 16:17:17
1448+
RedirectTemp /bd https://docs.python.org/pt-br/3/library/types.html#types.SimpleNamespace
1449+
RedirectTemp /be https://docs.python.org/pt-br/3/library/argparse.html#argparse.Namespace
1450+
RedirectTemp /bf https://docs.python.org/pt-br/3/library/multiprocessing.html#multiprocessing.managers.Namespace
1451+
RedirectTemp /bg https://docs.python.org/pt-br/3/library/functools.html#functools.cached_property
1452+
RedirectTemp /bh https://docs.python.org/pt-br/3.10/library/functools.html#functools.cached_property
1453+
RedirectTemp /bj https://docs.python.org/pt-br/3/library/functions.html#dir
1454+
RedirectTemp /bk https://docs.python.org/pt-br/3/library/functions.html#hasattr
1455+
RedirectTemp /bm https://docs.python.org/pt-br/3.10/reference/datamodel.html#special-method-lookup
1456+
RedirectTemp /bn https://docs.python.org/pt-br/3/library/functions.html
1457+
RedirectTemp /bp https://docs.python.org/pt-br/3/library/threading.html#rlock-objects
1458+
RedirectTemp /bq https://pt.wikipedia.org/wiki/Mutex_recursivo
1459+
RedirectTemp /br https://docs.python.org/pt-br/3/reference/datamodel.html#customizing-attribute-access
1460+
RedirectTemp /bs https://docs.python.org/pt-br/3/reference/datamodel.html#special-method-lookup
1461+
RedirectTemp /bt https://docs.python.org/pt-br/3/library/stdtypes.html#special-attributes
1462+
# cap23: appended 2026-01-09 16:32:34
1463+
RedirectTemp /bv https://docs.python.org/pt-br/3/howto/descriptor.html
1464+
RedirectTemp /bw https://docs.python.org/pt-br/3/howto/
1465+
1466+
# cap24: appended 2026-01-09 16:37:23
1467+
RedirectTemp /bx https://docs.python.org/pt-br/3/reference/datamodel.html#creating-the-class-object
1468+
RedirectTemp /by https://docs.python.org/pt-br/3/reference/datamodel.html#customizing-class-creation
1469+
RedirectTemp /bz https://docs.python.org/pt-br/3/library/types.html
1470+
RedirectTemp /c2 https://docs.python.org/pt-br/3/reference/datamodel.html#object.__init_subclass__
1471+
RedirectTemp /c3 https://pt.wikipedia.org/wiki/Programa%C3%A7%C3%A3o_orientada_a_aspecto
1472+
RedirectTemp /c4 https://docs.python.org/pt-br/3/library/functions.html#type

links/encurtar.ipynb

Lines changed: 35 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,48 +10,42 @@
1010
},
1111
{
1212
"cell_type": "code",
13-
"execution_count": 2,
13+
"execution_count": 1,
1414
"id": "565ac98b-4f9e-4fd7-b23d-7bddcf2dd60a",
1515
"metadata": {},
1616
"outputs": [],
1717
"source": [
18-
"from list_urls import find_urls\n"
18+
"from list_urls import find_urls"
1919
]
2020
},
2121
{
2222
"cell_type": "code",
23-
"execution_count": 9,
23+
"execution_count": 29,
2424
"id": "0f2ce1b8-1c45-41a0-9f38-675e6912d805",
2525
"metadata": {},
2626
"outputs": [
2727
{
2828
"name": "stdout",
2929
"output_type": "stream",
3030
"text": [
31-
"= /a3\thttps://docs.python.org/3/library/sqlite3.html#using-the-connection-as-a-context-manager\n",
32-
"= /9q\thttps://docs.python.org/pt-br/3/library/threading.html#using-locks-conditions-and-semaphores-in-the-with-statement\n",
33-
"= /9r\thttps://docs.python.org/pt-br/3/library/decimal.html#decimal.localcontext\n",
34-
"= /9s\thttps://docs.python.org/pt-br/3/library/unittest.mock.html#patch\n",
35-
"= /9t\thttps://docs.python.org/pt-br/3/library/contextlib.html\n",
36-
"= /9v\thttps://docs.python.org/pt-br/3/library/fileinput.html#fileinput.input\n",
37-
"= /9w\thttps://pt.wikipedia.org/wiki/Algoritmo_de_Euclides\n",
38-
"= /9x\thttps://docs.python.org/pt-br/3/reference/compound_stmts.html\n",
39-
"= /9y\thttps://docs.python.org/pt-br/3/glossary.html#term-eafp\n",
40-
"= /9x\thttps://docs.python.org/pt-br/3/reference/compound_stmts.html\n",
41-
"= /9z\thttps://docs.python.org/pt-br/3/library/stdtypes.html#typecontextmanager\n",
42-
"= /a2\thttps://pt.wikipedia.org/wiki/Recursividade_(ci%C3%AAncia_da_computa%C3%A7%C3%A3o)#Fun%C3%A7%C3%B5es_recursivas_em_cauda\n"
31+
"= /bt\thttps://docs.python.org/pt-br/3/library/stdtypes.html#special-attributes\n",
32+
"+ /bx\thttps://docs.python.org/pt-br/3/reference/datamodel.html#creating-the-class-object\n",
33+
"= /2j\thttps://docs.python.org/pt-br/3/reference/datamodel.html\n",
34+
"+ /by\thttps://docs.python.org/pt-br/3/reference/datamodel.html#customizing-class-creation\n",
35+
"+ /bz\thttps://docs.python.org/pt-br/3/library/types.html\n",
36+
"= /7q\thttps://docs.python.org/pt-br/3/library/functools.html#functools.total_ordering\n"
4337
]
4438
},
4539
{
4640
"name": "stderr",
4741
"output_type": "stream",
4842
"text": [
49-
"0 directives appended to FPY.LI.htaccess\n"
43+
"3 directives appended to FPY.LI.htaccess\n"
5044
]
5145
}
5246
],
5347
"source": [
54-
"CAP = 18\n",
48+
"CAP = 25\n",
5549
"\n",
5650
"adoc_path = f'../online/cap{CAP}.adoc'\n",
5751
"\n",
@@ -68,26 +62,20 @@
6862
},
6963
{
7064
"cell_type": "code",
71-
"execution_count": 10,
65+
"execution_count": 30,
7266
"id": "37c13b84-c4a4-4295-8987-205c8da7a2e5",
7367
"metadata": {},
7468
"outputs": [
7569
{
7670
"name": "stdout",
7771
"output_type": "stream",
7872
"text": [
79-
"= /a3\thttps://docs.python.org/3/library/sqlite3.html#using-the-connection-as-a-context-manager\n",
80-
"= /9q\thttps://docs.python.org/pt-br/3/library/threading.html#using-locks-conditions-and-semaphores-in-the-with-statement\n",
81-
"= /9r\thttps://docs.python.org/pt-br/3/library/decimal.html#decimal.localcontext\n",
82-
"= /9s\thttps://docs.python.org/pt-br/3/library/unittest.mock.html#patch\n",
83-
"= /9t\thttps://docs.python.org/pt-br/3/library/contextlib.html\n",
84-
"= /9v\thttps://docs.python.org/pt-br/3/library/fileinput.html#fileinput.input\n",
85-
"= /9w\thttps://pt.wikipedia.org/wiki/Algoritmo_de_Euclides\n",
86-
"= /9x\thttps://docs.python.org/pt-br/3/reference/compound_stmts.html\n",
87-
"= /9y\thttps://docs.python.org/pt-br/3/glossary.html#term-eafp\n",
88-
"= /9x\thttps://docs.python.org/pt-br/3/reference/compound_stmts.html\n",
89-
"= /9z\thttps://docs.python.org/pt-br/3/library/stdtypes.html#typecontextmanager\n",
90-
"= /a2\thttps://pt.wikipedia.org/wiki/Recursividade_(ci%C3%AAncia_da_computa%C3%A7%C3%A3o)#Fun%C3%A7%C3%B5es_recursivas_em_cauda\n"
73+
"= /bt\thttps://docs.python.org/pt-br/3/library/stdtypes.html#special-attributes\n",
74+
"+ /bx\thttps://docs.python.org/pt-br/3/reference/datamodel.html#creating-the-class-object\n",
75+
"= /2j\thttps://docs.python.org/pt-br/3/reference/datamodel.html\n",
76+
"+ /by\thttps://docs.python.org/pt-br/3/reference/datamodel.html#customizing-class-creation\n",
77+
"+ /bz\thttps://docs.python.org/pt-br/3/library/types.html\n",
78+
"= /7q\thttps://docs.python.org/pt-br/3/library/functools.html#functools.total_ordering\n"
9179
]
9280
}
9381
],
@@ -98,25 +86,20 @@
9886
},
9987
{
10088
"cell_type": "code",
101-
"execution_count": 11,
89+
"execution_count": 31,
10290
"id": "25b20f6b-471f-4a14-bdd0-22eb21627962",
10391
"metadata": {},
10492
"outputs": [
10593
{
10694
"name": "stdout",
10795
"output_type": "stream",
10896
"text": [
109-
"/a3 https://docs.python.org/3/library/sqlite3.html#using-the-connection-as-a-context-manager\n",
110-
"/9q https://docs.python.org/pt-br/3/library/threading.html#using-locks-conditions-and-semaphores-in-the-with-statement\n",
111-
"/9r https://docs.python.org/pt-br/3/library/decimal.html#decimal.localcontext\n",
112-
"/9s https://docs.python.org/pt-br/3/library/unittest.mock.html#patch\n",
113-
"/9t https://docs.python.org/pt-br/3/library/contextlib.html\n",
114-
"/9v https://docs.python.org/pt-br/3/library/fileinput.html#fileinput.input\n",
115-
"/9w https://pt.wikipedia.org/wiki/Algoritmo_de_Euclides\n",
116-
"/9x https://docs.python.org/pt-br/3/reference/compound_stmts.html\n",
117-
"/9y https://docs.python.org/pt-br/3/glossary.html#term-eafp\n",
118-
"/9z https://docs.python.org/pt-br/3/library/stdtypes.html#typecontextmanager\n",
119-
"/a2 https://pt.wikipedia.org/wiki/Recursividade_(ci%C3%AAncia_da_computa%C3%A7%C3%A3o)#Fun%C3%A7%C3%B5es_recursivas_em_cauda\n"
97+
"/bt https://docs.python.org/pt-br/3/library/stdtypes.html#special-attributes\n",
98+
"/bx https://docs.python.org/pt-br/3/reference/datamodel.html#creating-the-class-object\n",
99+
"/2j https://docs.python.org/pt-br/3/reference/datamodel.html\n",
100+
"/by https://docs.python.org/pt-br/3/reference/datamodel.html#customizing-class-creation\n",
101+
"/bz https://docs.python.org/pt-br/3/library/types.html\n",
102+
"/7q https://docs.python.org/pt-br/3/library/functools.html#functools.total_ordering\n"
120103
]
121104
}
122105
],
@@ -130,16 +113,6 @@
130113
"\n"
131114
]
132115
},
133-
{
134-
"cell_type": "code",
135-
"execution_count": 6,
136-
"id": "a66fdca6-e1df-4b1d-8971-1baae54cb9ed",
137-
"metadata": {},
138-
"outputs": [],
139-
"source": [
140-
"!grep 'https://(?!f[^./]*\\.)[a-zA-Z0-9.-]+[^/]*' ../online/cap17.adoc # não está funcionando!"
141-
]
142-
},
143116
{
144117
"cell_type": "markdown",
145118
"id": "0eac9caf-6793-41c4-8fa3-4f3511c1d515",
@@ -150,6 +123,16 @@
150123
"```https://(?!f[^.]+\\.)[^/]+```"
151124
]
152125
},
126+
{
127+
"cell_type": "code",
128+
"execution_count": 37,
129+
"id": "a66fdca6-e1df-4b1d-8971-1baae54cb9ed",
130+
"metadata": {},
131+
"outputs": [],
132+
"source": [
133+
"!rg --pcre2 'https://(?!f[^.]+\\.)[^/]+' ../online/cap24.adoc"
134+
]
135+
},
153136
{
154137
"cell_type": "code",
155138
"execution_count": null,

links/list_urls.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ def find_urls(lines, fpy=True, long=True):
1414
is_fpy = '://fpy.li/' in url
1515
if (is_fpy and not fpy) or (not is_fpy and not long):
1616
continue
17+
if url.endswith('fluentpython.com'):
18+
# keep uses in examples in chapter 20
19+
continue
1720
urls.append(url)
1821
return urls
1922

0 commit comments

Comments
 (0)