Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d09ed68

Browse files
committed
Note that it is illegal to delete a cell variable.
Note that deleteing an unbound local will raise a NameError.
1 parent 2225add commit d09ed68

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Doc/ref/ref6.tex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,16 @@ \section{The \keyword{del} statement \label{del}}
338338
Deletion of a target list recursively deletes each target, from left
339339
to right.
340340

341-
Deletion of a name removes the binding of that name (which must exist)
341+
Deletion of a name removes the binding of that name
342342
from the local or global namespace, depending on whether the name
343-
occurs in a \keyword{global} statement in the same code block.
343+
occurs in a \keyword{global} statement in the same code block. If the
344+
name is unbound, a \exception{NameError} exception will be raised.
344345
\stindex{global}
345346
\indexii{unbinding}{name}
346347

348+
It is illegal to delete a name from the local namespace if it occurs
349+
as a free variable\indexii{free}{varaible} in a nested block.
350+
347351
Deletion of attribute references, subscriptions and slicings
348352
is passed to the primary object involved; deletion of a slicing
349353
is in general equivalent to assignment of an empty slice of the

0 commit comments

Comments
 (0)