]> granicus.if.org Git - python/commitdiff
Note that it is illegal to delete a cell variable.
authorJeremy Hylton <jeremy@alum.mit.edu>
Mon, 1 Apr 2002 21:15:14 +0000 (21:15 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Mon, 1 Apr 2002 21:15:14 +0000 (21:15 +0000)
Note that deleteing an unbound local will raise a NameError.

Doc/ref/ref6.tex

index 77104725368a3bb5f09e6c5b18b4162e2d11bd82..0ce94be51af8056778385acb19b668b985fd43d9 100644 (file)
@@ -338,12 +338,16 @@ hints.
 Deletion of a target list recursively deletes each target, from left
 to right.
 
-Deletion of a name removes the binding of that name (which must exist)
+Deletion of a name removes the binding of that name 
 from the local or global namespace, depending on whether the name
-occurs in a \keyword{global} statement in the same code block.
+occurs in a \keyword{global} statement in the same code block.  If the
+name is unbound, a \exception{NameError} exception will be raised.
 \stindex{global}
 \indexii{unbinding}{name}
 
+It is illegal to delete a name from the local namespace if it occurs
+as a free variable\indexii{free}{varaible} in a nested block.
+
 Deletion of attribute references, subscriptions and slicings
 is passed to the primary object involved; deletion of a slicing
 is in general equivalent to assignment of an empty slice of the