-
Notifications
You must be signed in to change notification settings - Fork 1
/
plan.txt
189 lines (95 loc) · 3.44 KB
/
plan.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
Part 1 : the differences between python 2 and 3
Chapter 0: which python 3 ?
Chapter 1 : the small things
print, iterkeys, map, division, builtin, long, syntax, exceptions, inheritance, true, false
Chapter 2: imports
Name changes, absolute imports
Chapter 3: bytes and text handling
Chapter 4: deprecation
Stdlib, 3rd party
Chapter 5: subtil traps
Pickle, ssl, async/await
Chapter 6: c extensions
Part 2 : how to migrate
Chapter 5 : how NOT to migrate
Pypy, nuikta, docker, vendoring, pex, pinpoint dependancies
Chapter 5 bis: prepare your project
Get rid of *.
Get rid of old style class.
Write test if you can. Pytest.
Setup linters and text formatter.
Decide if you want a compatible code base or a migration
Can you use mypy ?
Don't do anything else while migrating.
Stop all python 2 new project.
Chapter 6: low hanging fruits
2 to 3, from future, manuall fixing
Chapter 7 : Chapter restructuring the project
Imports, layout,
Chapter 7: compatible code base
Python future, backports
Chapter 8: fighting deprecation
What to replace with what ?
Chapter 9 : bytes and str
Pathlib, open, network, u, future...
Chapter 10: new features to take advantage of
Fstring
Asyncio
Statistic
Debug
Dataclass
Migrate from python 2 to 3
This book assumes you are already commited to convert your code to python 3, hence, it will not try to convince you to do so.
Instead, the book will be divided in two parts.
The first one lists and explains as much differences as it can between version 2 and 3. This will allow you to understand not only what's going on.
The second one describes a step by step strategy, with suggested tooling, to actually performs the migration.
If you read the content from start to finish, it will seems overwhelming. Fortunatly, most projects don't actually need to apply half of the advices given here. The vast majority of code bases can be just tinkered with, hacking on it until it works, sampling solutions from these pages on the way.
If you are in a rush, a surprisingly high number of projects can get away with just chapter 6.
.. toctree::
:maxdepth: 2
differences
strings
datatypes
numeric
(many more documents listed here)
Part 1 : the differences between python 2 and 3
Chapter 0: which python 3 ?
Chapter 1 : the small things
print, iterkeys, map, division, builtin, long, syntax, exceptions, inheritance, true, false
Chapter 2: imports
Name changes, absolute imports
Chapter 3: bytes and text handling
Chapter 4: deprecation
Stdlib, 3rd party
Chapter 5: subtil traps
Pickle, ssl, async/await
Chapter 6: c extensions
Part 2 : how to migrate
Chapter 5 : how NOT to migrate
Pypy, nuikta, docker, vendoring, pex, pinpoint dependancies
Chapter 5 bis: prepare your project
Get rid of *.
Get rid of old style class.
Write test if you can. Pytest.
Setup linters and text formatter.
Decide if you want a compatible code base or a migration
Can you use mypy ?
Don't do anything else while migrating.
Stop all python 2 new project.
Chapter 6: low hanging fruits
2 to 3, from future, manuall fixing
Chapter 7 : Chapter restructuring the project
Imports, layout,
Chapter 7: compatible code base
Python future, backports
Chapter 8: fighting deprecation
What to replace with what ?
Chapter 9 : bytes and str
Pathlib, open, network, u, future...
Chapter 10: new features to take advantage of
Fstring
Asyncio
Statistic
Debug
Dataclass
https://authorunlimited.com/blog/50-ways-to-promote-your-book