Skip to content

Commit d79893a

Browse files
committed
Add news item for new f-string bytecodes and bump magic number.
1 parent 8ec15b3 commit d79893a

File tree

3 files changed

+117
-113
lines changed

3 files changed

+117
-113
lines changed

Lib/importlib/_bootstrap_external.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ def _write_atomic(path, data, mode=0o666):
247247
# Python 3.7a4 3392 (PEP 552: Deterministic pycs #31650)
248248
# Python 3.7b1 3393 (remove STORE_ANNOTATION opcode #32550)
249249
# Python 3.8a1 3400 (move frame block handling to compiler #17611)
250+
# Python 3.8a1 3401 (more efficient bytecodes for f-strings #33092)
250251
#
251252
# MAGIC must change whenever the bytecode emitted by the compiler may no
252253
# longer be understood by older implementations of the eval loop (usually
@@ -255,7 +256,7 @@ def _write_atomic(path, data, mode=0o666):
255256
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
256257
# in PC/launcher.c must also be updated.
257258

258-
MAGIC_NUMBER = (3400).to_bytes(2, 'little') + b'\r\n'
259+
MAGIC_NUMBER = (3401).to_bytes(2, 'little') + b'\r\n'
259260
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
260261

261262
_PYCACHE = '__pycache__'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Simplify and speed up interpreter for f-strings: Remove FORMAT_VALUE
2+
opcode. Add CONVERT_VALUE, FORMAT_SIMPLE and FORMAT_WITH_SPEC opcode.
3+
Compiler emits optimal sequence for each format expression.

0 commit comments

Comments
 (0)