mirror of
https://github.com/python/cpython.git
synced 2025-09-11 03:07:01 +00:00
Bug #1333982: string/number constants were inappropriately stored
in the byte code and co_consts even if they were not used, ie immediately popped off the stack.
This commit is contained in:
parent
4ffedadb10
commit
0cbd805a10
3 changed files with 25 additions and 2 deletions
|
@ -61,6 +61,23 @@ nlocals: 1
|
|||
flags: 67
|
||||
consts: ('None',)
|
||||
|
||||
>>> def optimize_away():
|
||||
... 'doc string'
|
||||
... 'not a docstring'
|
||||
... 53
|
||||
... 53L
|
||||
|
||||
>>> dump(optimize_away.func_code)
|
||||
name: optimize_away
|
||||
argcount: 0
|
||||
names: ()
|
||||
varnames: ()
|
||||
cellvars: ()
|
||||
freevars: ()
|
||||
nlocals: 0
|
||||
flags: 67
|
||||
consts: ("'doc string'", 'None')
|
||||
|
||||
"""
|
||||
|
||||
def consts(t):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue