Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9ee78f7

Browse files
committed
the new new doesn't define CO_xxx as the old new did
1 parent fff252d commit 9ee78f7

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

Lib/compiler/consts.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from new import * # import all the CO_xxx flags
21
del classobj, code, function, instance, instancemethod, module
32

43
# operation flags
@@ -11,3 +10,12 @@
1110
SC_FREE = 3
1211
SC_CELL = 4
1312
SC_UNKNOWN = 5
13+
14+
CO_OPTIMIZED = 0x0001
15+
CO_NEWLOCALS = 0x0002
16+
CO_VARARGS = 0x0004
17+
CO_VARKEYWORDS = 0x0008
18+
CO_NESTED = 0x0010
19+
CO_GENERATOR = 0x0020
20+
CO_GENERATOR_ALLOWED = 0x1000
21+
CO_FUTURE_DIVISION = 0x2000

Tools/compiler/compiler/consts.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from new import * # import all the CO_xxx flags
21
del classobj, code, function, instance, instancemethod, module
32

43
# operation flags
@@ -11,3 +10,12 @@
1110
SC_FREE = 3
1211
SC_CELL = 4
1312
SC_UNKNOWN = 5
13+
14+
CO_OPTIMIZED = 0x0001
15+
CO_NEWLOCALS = 0x0002
16+
CO_VARARGS = 0x0004
17+
CO_VARKEYWORDS = 0x0008
18+
CO_NESTED = 0x0010
19+
CO_GENERATOR = 0x0020
20+
CO_GENERATOR_ALLOWED = 0x1000
21+
CO_FUTURE_DIVISION = 0x2000

0 commit comments

Comments
 (0)