You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python-312/README.md
+84-2Lines changed: 84 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,12 @@ You need Python 3.12 installed to run these examples. See the following tutorial
8
8
9
9
-[How Can You Install a Pre-Release Version of Python](https://realpython.com/python-pre-release/)
10
10
11
+
Note that for the `perf` support, you'll need to build Python from source code with additional compiler flags enabled, as [explained below](#support-for-the-linux-perf-profiler).
12
+
11
13
You can learn more about Python 3.12's new features in the following Real Python tutorials:
-[Python 3.12 Preview: Support For the Linux `perf` Profiler](https://realpython.com/python312-perf-profiler/)
14
17
15
18
You'll find examples from all these tutorials in this repository.
16
19
@@ -20,7 +23,7 @@ This section only contains brief instructions on how you can run the examples. S
20
23
21
24
### Improved Error Messages
22
25
23
-
Run [`encoder.py](encoder.py) to create an encoded message like the one shown in the tutorial. You can decode the message using [`decoder.py](decoder.py).
26
+
Run [`encoder.py`](error-messages/encoder.py) to create an encoded message like the one shown in the tutorial. You can decode the message using [`decoder.py`](error-messages/decoder.py).
24
27
25
28
You can swap the import statement to `import d from this` in either of the files to encounter the improved error message:
26
29
@@ -32,14 +35,93 @@ You can swap the import statement to `import d from this` in either of the files
32
35
SyntaxError: Did you mean to use 'from ... import ...' instead?
33
36
```
34
37
35
-
In [`local_self.py`](local_self.py), you can see a naive reproduction of another improved error message. Pick apart the example code to learn more about how this was implemented in Python 3.12.
38
+
In [`local_self.py`](error-messages/local_self.py), you can see a naive reproduction of another improved error message. Pick apart the example code to learn more about how this was implemented in Python 3.12.
36
39
37
40
See [Ever Better Error Messages in Python 3.12](https://realpython.com/python312-error-messages/) for more information.
38
41
42
+
### Support For the Linux `perf` Profiler
43
+
44
+
#### Setting Up
45
+
46
+
You'll need to download, build, and install Python 3.12 from the source code with the frame pointer optimizations disabled:
0 commit comments