-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
322 lines (302 loc) · 16.2 KB
/
index.html
File metadata and controls
322 lines (302 loc) · 16.2 KB
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Shall We Upgrade? Navigating Python's Rapid Evolution</title>
<meta name="description" content="A guide to different Python versions and their features">
<meta name="author" content="Wenxin Jiang">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="dist/reset.css">
<link rel="stylesheet" href="dist/reveal.css">
<link rel="stylesheet" href="dist/theme/league.css" id="theme">
<link rel="stylesheet" href="dist/theme/black.css" id="theme">
<link rel="stylesheet" href="css/custom.css">
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h2>Shall We Upgrade?<br/>Navigating Python's Rapid Evolution</h2>
<div style="display: flex; justify-content: center; align-items: center; gap: 4rem; margin-top: 2.5em;">
<img src="img/pycon_logo.svg" alt="PyCon HK Logo" style="height: 160px;">
<div style="text-align: center;margin-left: 2rem;margin-right: 2rem;">
<p style="margin: 0;">Wenxin Jiang, Jian Yin</p>
<p style="margin: 0; font-size: 0.8em;">Oct. 11, 2025</p>
</div>
<img src="img/CityU_logo.svg" alt="CityU Logo" style="height: 120px;">
</div>
<aside class="notes">
Good afternoon! I'm Jiang Wenxin. This work is done in collaboration with Yin Jian. We are both PhD students at CityUHK.
Before today's talk, let me do a quick survey first: I'm sure many of you have noticed that Python 3.14 has officially launched. But how many of you have already checked out what's new in 3.14? If you have, please raise your hand. (Let me see.)
All right, thank you.
(Great!) Looks like many of you are already familiar with the new features.
(Okay, not so many? No worries!) That’s exactly why I’m here today.
So the goal of this talk is simple: I wanna share my experience in how to catch up with the latest changes. We’ll take a look at several changes from Python 3.10 to 3.14. You’ll see how these changes are making Python even more enjoyable to use.
Let's get started.
</aside>
</section>
<section>
<h3>Release Rhythm · Where We Are</h3>
<img src="img/status_python_version.png" alt="Python Release Cycle" style="width:90%;box-shadow:0 0 8px rgb(255, 255, 255);border-radius:8px;">
<p style="font-size:0.6em;margin-top:0.6em">
Source: <a href="https://devguide.python.org/versions/" target="_blank">Status of Python versions:<br>devguide.python.org/versions/</a>
</p>
<aside class="notes">
Actually, the release of Python now is stable: a new major version launches every October.
This chart is a screenshot from the official Python versions page.
Each row is a version, and you can see the entire journey — from adopting new features, to only fixing bugs and security, and finally reaching its end-of-life.
The blue line shows us where we are today, right after the release of Python 3.14.
</aside>
</section>
<section>
<h3>What’s New Series · How to Follow</h3>
<ul>
<li>Official doc: <a href="https://docs.python.org/3/whatsnew/index.html" target="_blank">docs.python.org/3/whatsnew</a></li>
<li>
Each feature is specified in the
<a href="https://peps.python.org/" target="_blank" rel="noreferrer">PEP</a> (Python Enhancement Proposal)
</li>
</ul>
<img src="img/whats_new_python.png" alt="Screenshot of the 'What's New in Python' hub showing sections like Release Highlights, New Features, Optimizations" style="width:70%;box-shadow:0 0 8px rgb(255, 255, 255);border-radius:8px;">
<p style="font-size:0.6em;margin-top:-0.5em;">
Docs hub: <a href="https://docs.python.org/3.13/whatsnew/index.html" target="_blank">What's New in Python</a> ·
<a href="https://peps.python.org/" target="_blank">PEP index</a>.
</p>
<aside class="notes">
So, how do we keep up with all these changes? I’d like to highlight two key resources: the 'What's New' pages and PEPs.
Think of the 'What's New' page as a summary for each release. It's a perfect way for us to quickly get a high-level overview of the most important updates.
But when we need more details of a specific feature, here's the PEP. Python Enhancement Proposal, is the official design document. It gives you the technical details, motivation and rationale behind a change.
Here's how an idea becomes a Python feature: It usually starts with discussion on public forums. If there's enough interest, someone will draft a proposal. They will find a core dev to sponsor it, submit it as a pull request to the PEPs repository.
Then, discuss and refine it. The proposal eventually goes to the Steering Council for a final decision. This open process is a core strength of the Python
ecosystem.
In short, the What's New page tells us what has changed, while the PEP explains why and how.
</aside>
</section>
<section>
<h3>Structure of "What's New" Pages</h3>
<div style="display:flex;gap:2rem;align-items:flex-start;">
<div style="flex:1;">
<p>Core Features</p>
<ul style="font-size:0.8em;">
<li><strong>Release Highlights</strong></li>
<li><strong>New Features</strong></li>
<li>Type Hints</li>
<li>Other Language Changes</li>
</ul>
</div>
<div style="flex:1;">
<p>Technical Details</p>
<ul style="font-size:0.8em;">
<li><strong>Interpreter / Security / C API</strong></li>
<li><strong>Optimizations</strong></li>
<li><strong>New & Improved Modules</strong></li>
<li>Deprecated & Removed Modules</li>
</ul>
</div>
</div>
<p style="font-size:0.7em;margin-top:1em;">
<strong>Tip:</strong> Start with highlights → New Features → [your interests].
</p>
<aside class="notes">
Although the Whats New page is quite long, it's very well-organized.
We can first start with the Release Highlights. This section is the official summary and gives you the information about the most critical updates.
Then, we'll move on to the New Features. Here, you’ll find the major language changes, which are often highly relevant to our coding work.
Finally, we can dive into the details. For example, if you're interested in specific areas like optimizations, C API, or module changes, you can jump to those sections directly. This way, you can focus on what matters most to you.
</aside>
</section>
<section>
<h3>3.10 · New syntax feature:<br> Structural Pattern Matching</h3>
Declarative <em>match/case</em> replaces nested if/elif
<pre><code class="hljs python">def http_error(status):
match status:
case 400:
return "Bad request"
case 401 | 403 | 404:
return "Not allowed"
case _: # wildcard
return "Something's wrong"</code></pre>
<p style="font-size:0.6em">
Docs: <a href="https://docs.python.org/3.10/whatsnew/3.10.html" target="_blank">What’s New in 3.10</a> ·
PEPs: <a href="https://peps.python.org/pep-0634/" target="_blank">PEP 634</a>, <a href="https://peps.python.org/pep-0635/" target="_blank">635</a>, <a href="https://peps.python.org/pep-0636/" target="_blank">636</a>.
</p>
<aside class="notes">
I'll introduce the update in Python with an example from Python 3.10: Structural Pattern Matching. This introduced the match/case statement, like the switch in C++, providing an elegant alternative to long if/elif/else chains.
In this code, the status variable can be matched against a specific value, a set of values or a wildcard.
This declarative style makes our code easy to write and read.
</aside>
</section>
<section data-visibility="hidden">
<h3>3.10 · New typing feature:<br>Union Types</h3>
<pre><code class="hljs python"># before
from typing import Union
def fun(x: Union[str, bytes]):
# after
def f(x: str | bytes):
</code></pre>
<p style="font-size:0.6em">
Docs: <a href="https://docs.python.org/3.10/whatsnew/3.10.html" target="_blank">What's New in 3.10</a> ·
PEP: <a href="https://peps.python.org/pep-0604/" target="_blank">PEP 604</a>, <a href="https://peps.python.org/pep-0613/" target="_blank">PEP 613</a>, <a href="https://peps.python.org/pep-0647/" target="_blank">PEP 647</a>.
</p>
<aside class="notes">
Also in Python 3.10, the syntax for type hints saw a great quality-of-life improvement with Union Types.
Before this change, to type a variable that could be either a string or bytes, you had to import Union from the typing
module. The syntax, Union of string and bytes, worked, but it was verbose.
Now, you can simply use the vertical bar as a union operator. The expression str | bytes is more readable, more
intuitive, and doesn't require any imports for use in type annotations.
</aside>
</section>
<section>
<h3>3.11 · Highlights: A Free Speed Boost</h3>
<!-- https://docs.python.org/3.13/whatsnew/3.11.html#faster-cpython -->
CPython 3.11 is an average of <strong>25%</strong> faster than 3.10, with <strong>10–60%</strong> overall speed improvements.</li>
<ul style="font-size:0.8em">
<li>Faster Startup: Interpreter startup is now <strong>10-15%</strong> faster.</li>
<li>Faster Runtime: Cheaper, lazy Python frames</li>
</ul>
<img src="img/pyperformance.svgz" alt="Bar chart showing speed improvements of Python 3.11 over 3.10 across various benchmarks" style="width:55%;box-shadow:0 0 8px rgb(255, 255, 255);border-radius:8px;">
<p style="font-size:0.8em">
Docs: <a href="https://docs.python.org/3/whatsnew/3.11.html" target="_blank">What’s New in 3.11 (Release highlights)</a> · <a href="https://openbenchmarking.org/result/2205310-PTS-PYTHON3127#results" target="_blank">Benchmark</a>
</p>
<aside class="notes">
Now, I wanna highlight the multi-year effort to make Python faster and achieve its truly parallel execution. Python 3.11 marked the real beginning of this journey.
Python 3.11 delivered a free speed boost, reducing runtime without requiring any changes to your code. It's about 25% faster on average, thanks to a faster startup of the interpreter and runtime optimizations. This impressive performance improvement set the stage for the next step: tackling true parallelism.
</aside>
</section>
<section>
<h3>3.13 · Experimental Free‑Threaded</h3>
<p style="margin-bottom: 0em;">Global Interpreter Lock ensures only one Python thread executes at a time</p>
<div style="display:flex;gap:0.5rem;margin-top:0em;">
<div style="flex:1;">
<h4 style="color:#90EE90;font-size:1.2em;">✓ Benefits</h4>
<ul style="font-size:0.8em;">
<li>True parallel execution for CPU-bound tasks</li>
<li>Better multi-core utilization</li>
<li>No need for multiprocessing overhead</li>
</ul>
</div>
<div style="flex:1;">
<h4 style="color:#FFA07A;font-size:1.2em;">⚠ Trade-offs</h4>
<ul style="font-size:0.8em;">
<li>Single-threaded code may be slower</li>
<li>C extensions need compatibility updates</li>
<li>Memory usage increases</li>
</ul>
</div>
</div>
<p style="font-size:0.8em">
Docs: <a href="https://docs.python.org/3/whatsnew/3.13.html" target="_blank">What's New in 3.13</a> ·
PEP 703: <a href="https://peps.python.org/pep-0703/" target="_blank">Making the GIL Optional</a>
</p>
<aside class="notes">
The main challenge of taking advantage of multi-CPU systems has always been the Global Interpreter Lock, or GIL, which kept Python stuck on just one CPU core at a time.
But with Python 3.13, this problem was addressed through an experimental free-threaded mode.
Of course, there are some trade-offs. Single-threaded code might run slightly slower. C extensions also need updates to ensure compatibility, which means extra effort for third-party library developers. And memory usage increased slightly.
</aside>
</section>
<section>
<h3 style="line-height: 1.2em;">
<span style="display: inline-block; text-align: left;">
3.14 · Official Free‑Threaded<br>
<span style="padding-left: 1.6em;">& Multiple interpreters</span>
</span>
</h3>
<ul>
<li><strong>PEP 779</strong>: Free‑threaded Python is <em>officially supported</em> (still optional).</li>
<li><strong>PEP 734</strong>: Multiple interpreters in the stdlib for true multi‑core parallelism.</li>
</ul>
<p style="font-size:0.8em">
Docs: <a href="https://docs.python.org/3.14/whatsnew/3.14.html" target="_blank">What’s New in 3.14</a> ·
<a href="https://peps.python.org/pep-0779/" target="_blank">PEP 779</a> ·
<a href="https://peps.python.org/pep-0734/" target="_blank">PEP 734</a> ·
</p>
<aside class="notes">
Python 3.14 takes two steps further. First, the free-threaded mode is now officially supported.
Second, the ability to manage multiple interpreters is now exposed in the standard library.
With these significant developments, Python finally unlocks its ability to execute truly parallel code across multiple CPU cores.
</aside>
</section>
<section data-visibility="hidden">
<h3>Package Migration · uv</h3>
<ul>
<li>🚀 Replace pip with similar interface</li>
<li>⚡️ 10-100x <strong>faster</strong> than pip</li>
<li>🗂️ Provides <strong>comprehensive project management</strong></li>
</ul>
<pre><code class="hljs bash">uv init # create project
# install and pin specific Python version
uv python install 3.13
uv python pin 3.13
# install packages
uv add package-name
uv add -r requirements.txt
</code></pre>
<p style="font-size:0.8em">
Docs: <a href="https://docs.astral.sh/uv/guides/install-python/" target="_blank">uv: install Python</a>
· Migration guide: <a href="https://docs.astral.sh/uv/guides/migration/pip-to-project/" target="_blank">pip to uv</a>.
</p>
<aside class="notes">
As we explore these new Python features, you'll want modern tools to manage your environments. Tools like uv make it
effortless to install and manage specific Python versions with incredible speed. This is especially useful when
experimenting with different Python releases or testing new features in isolated environments.
</aside>
</section>
<section>
<h3>Takeaways</h3>
<ul>
<li>Annual release: 3.11 (2022), 3.12 (2023), 3.13 (2024), 3.14 (2025)...</li>
<li>"What’s New" pages summarize key changes.</li>
<li>PEPs provide detailed design docs for new features.</li>
<li>Check Compatibility: Test it before using it.</li>
<li>Stay curious and keep exploring features!</li>
</ul>
<p style="font-size:0.8em">
</p>
<aside class="notes">
Let’s quickly recap the key takeaways.
First, I'd like to remind you that Python now follows a predictable annual release schedule.
Second, the Whats New pages provide a high-level summary, while the corresponding PEPs provide technical details.
Third, before adopting new features in production code, it's crucial to check compatibility and test whether they work well in your case.
And finally, all I want to say is: stay curious and keep exploring new features. Python is evolving rapidly, and there's always something new to learn.
</aside>
</section>
<section>
<h2>Thank you for attention!</h2>
<ul>
<li>Wenxin Jiang</li>
<li>GitHub: <a href="https://github.com/LucaJiang" target="_blank">LucaJiang</a></li>
<li>This presentation: <a href="https://lucajiang.github.io/new_in_python/">lucajiang.github.io/new_in_python/</a></li>
</ul>
<aside class="notes">
Thank you for your attention. You can find me on GitHub at LucaJiang, and the slides of this talk are available online.
</aside>
</section>
</div>
</div>
<script src="dist/reveal.js"></script>
<script src="plugin/math/math.js"></script>
<link rel="stylesheet" href="plugin/highlight/github-dark.css" id="highlight-theme" />
<script src="plugin/highlight/highlight.js"></script>
<script src="plugin/notes/notes.js"></script>
<script src="plugin/menu/menu.js"></script>
<script>
Reveal.initialize({
controls: true,
progress: true,
center: true,
hash: true,
// disableLayout: true,
transition: 'none',
slideNumber: true,
showSlideNumber: 'all',
help: true,
menu: {
titleSelector: 'h1, h2, h3',
hideMissingTitles: true,
},
plugins: [RevealHighlight, RevealNotes, RevealMenu],
});
</script>
</body>
</html>