• 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
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
Tools Loading commit data...
.bzrignore Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
runtests.sh Loading commit data...
setup.py Loading commit data...