[issue6250] Python compiles dead code
report at bugs.python.org
Wed Jun 10 05:59:45 CEST 2009
New submission from James Abbatiello <abbeyj at gmail.com>:
Python currently emits bytecode for code that is unreachable (e.g.
following a return statement). This doesn't hurt anything but it takes
up space doing nothing.
This patch attempts to avoid generating any bytecode in this situation.
There's an optional warning, enabled with the -r command line switch,
which notifies you if any unreachable code is found. Running
regrtest.py with this switch produces a bit of noise but also revealed
issue6227 which looks like a real bug.
components: Interpreter Core
nosy: abbeyj, collinwinter, jyasskin, pitrou
title: Python compiles dead code
versions: Python 2.7
Added file: http://bugs.python.org/file14252/deadcode.patch
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list