• Amaury Forgeot d'Arc's avatar
    #4617: Previously it was illegal to delete a name from the local · ba117ef7
    Amaury Forgeot d'Arc yazdı
    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.
    ba117ef7
Adı
Son kayıt (commit)
Son güncelleme
..
2.0.rst Loading commit data...
2.1.rst Loading commit data...
2.2.rst Loading commit data...
2.3.rst Loading commit data...
2.4.rst Loading commit data...
2.5.rst Loading commit data...
2.6.rst Loading commit data...
2.7.rst Loading commit data...
3.0.rst Loading commit data...
3.1.rst Loading commit data...
3.2.rst Loading commit data...
index.rst Loading commit data...