Skip to content

Commit 1196907

Browse files
committed
python_pickle: rename opcode::global{=>_opcode} to avoid Python keyword
Closes #518
1 parent e6893a0 commit 1196907

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

serialization/python_pickle.ksy

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ types:
109109
'opcode::ext1': u1
110110
'opcode::ext2': u2
111111
'opcode::ext4': u4
112-
'opcode::global': stringnl_noescape_pair
112+
'opcode::global_opcode': stringnl_noescape_pair
113113
'opcode::stack_global': no_arg
114114
'opcode::reduce': no_arg
115115
'opcode::build': no_arg
@@ -422,9 +422,14 @@ enums:
422422
-orig-id: BUILD
423423
doc: call __setstate__ or __dict__.update()
424424
0x63: # "c"
425-
id: "global"
425+
id: "global_opcode"
426426
-orig-id: GLOBAL
427-
doc: push self.find_class(modname, name); 2 string args
427+
-affected-by: 90
428+
doc: |
429+
push self.find_class(modname, name); 2 string args
430+
431+
As of KSC 0.9, this enum key can't be called `global` because it would
432+
cause a syntax error in Python (it is a keyword).
428433
0x64: # "d"
429434
id: "dict"
430435
-orig-id: DICT

0 commit comments

Comments
 (0)