| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,7 +17,7 @@ | |||
| 17 | 17 | freevars: () | |
| 18 | 18 | nlocals: 2 | |
| 19 | 19 | flags: 3 | |
| 20 | - consts: ('None', '<code object g>') | ||
| 20 | + consts: ('<code object g>',) | ||
| 21 | 21 | ||
| 22 | 22 | >>> dump(f(4).__code__) | |
| 23 | 23 | name: g | |
@@ -86,7 +86,7 @@ | |||
| 86 | 86 | cellvars: () | |
| 87 | 87 | freevars: () | |
| 88 | 88 | nlocals: 0 | |
| 89 | - flags: 3 | ||
| 89 | + flags: 67108867 | ||
| 90 | 90 | consts: ("'doc string'", 'None') | |
| 91 | 91 | ||
| 92 | 92 | >>> def keywordonly_args(a,b,*,k1): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -835,7 +835,7 @@ def f(): | |||
| 835 | 835 | return "unused" | |
| 836 | 836 | ||
| 837 | 837 | self.assertEqual(f.__code__.co_consts, | |
| 838 | - (None, "used")) | ||
| 838 | + (True, "used")) | ||
| 839 | 839 | ||
| 840 | 840 | @support.cpython_only | |
| 841 | 841 | def test_remove_unused_consts_extended_args(self): | |
@@ -853,9 +853,9 @@ def test_remove_unused_consts_extended_args(self): | |||
| 853 | 853 | eval(compile(code, "file.py", "exec"), g) | |
| 854 | 854 | exec(code, g) | |
| 855 | 855 | f = g['f'] | |
| 856 | - expected = tuple([None, '', 1] + [f't{i}' for i in range(N)]) | ||
| 856 | + expected = tuple(['', 1] + [f't{i}' for i in range(N)]) | ||
| 857 | 857 | self.assertEqual(f.__code__.co_consts, expected) | |
| 858 | - expected = "".join(expected[3:]) | ||
| 858 | + expected = "".join(expected[2:]) | ||
| 859 | 859 | self.assertEqual(expected, f()) | |
| 860 | 860 | ||
| 861 | 861 | # Stripping unused constants is not a strict requirement for the | |
@@ -1246,7 +1246,7 @@ def return_genexp(): | |||
| 1246 | 1246 | y) | |
| 1247 | 1247 | genexp_lines = [0, 4, 2, 0, 4] | |
| 1248 | 1248 | ||
| 1249 | - genexp_code = return_genexp.__code__.co_consts[1] | ||
| 1249 | + genexp_code = return_genexp.__code__.co_consts[0] | ||
| 1250 | 1250 | code_lines = self.get_code_lines(genexp_code) | |
| 1251 | 1251 | self.assertEqual(genexp_lines, code_lines) | |
| 1252 | 1252 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,7 +84,7 @@ def inner(): | |||
| 84 | 84 | return x | |
| 85 | 85 | return inner() % 2 | |
| 86 | 86 | ||
| 87 | - inner_code = mod_two.__code__.co_consts[1] | ||
| 87 | + inner_code = mod_two.__code__.co_consts[0] | ||
| 88 | 88 | assert isinstance(inner_code, types.CodeType) | |
| 89 | 89 | ||
| 90 | 90 | metadata = { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments