This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nnorwitz
Recipients nnorwitz
Date 2008-02-25.02:00:12
SpamBayes Score 0.008943157
Marked as misclassified No
Message-id <>
This patch optimizes code like:

   x = any_expression
   return x

   return any_expression

Currently it only optimizes out the local variable if there is a return
because it can't determine if this is the last use of the variable or not.

This shouldn't change behaviour under normal circumstances, but would
change behaviour with a debugger.  Perhaps this optimization should only
be performed if -O is passed on the command line?

This optimization saves two trips around the eval loop (STORE_FAST and
LOAD_FAST) and 6 bytes in the byte code.
Date User Action Args
2008-02-25 02:00:14nnorwitzsetspambayes_score: 0.00894316 -> 0.008943157
recipients: + nnorwitz
2008-02-25 02:00:14nnorwitzsetspambayes_score: 0.00894316 -> 0.00894316
messageid: <>
2008-02-25 02:00:13nnorwitzlinkissue2181 messages
2008-02-25 02:00:13nnorwitzcreate