Files
cpython/Lib
Amaury Forgeot d'Arc ba117ef7e9 #4617: Previously it was illegal to delete a name from the local
namespace if it occurs as a free variable in a nested block.  This limitation
of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).

This sample was valid in 2.6, but fails to compile in 3.x without this change::

   >>> def f():
   ...     def print_error():
   ...        print(e)
   ...     try:
   ...        something
   ...     except Exception as e:
   ...        print_error()
   ...        # implicit "del e" here


This sample has always been invalid in Python, and now works::

   >>> def outer(x):
   ...     def inner():
   ...        return x
   ...     inner()
   ...     del x

There is no need to bump the PYC magic number: the new opcode is used
for code that did not compile before.
2010-09-10 21:39:53 +00:00
..
2010-08-02 19:44:48 +00:00
2010-08-30 14:05:50 +00:00
2010-09-05 08:30:40 +00:00
2010-08-30 14:05:50 +00:00
2010-09-05 08:28:41 +00:00
2010-08-30 14:05:50 +00:00
2010-09-06 22:31:52 +00:00
2010-08-30 14:05:50 +00:00
2010-09-09 03:53:22 +00:00
2010-08-16 20:17:07 +00:00
2010-08-13 16:26:40 +00:00
2010-08-30 14:05:50 +00:00
2010-09-06 20:27:55 +00:00
2010-08-02 12:40:22 +00:00