The del statement

del

del_stmt:       "del" target_list

Deletion is recursively defined very similar to the way assignment is defined. Rather that spelling it out in full details, here are some hints. deletiontarget deletiontargetlist

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) from the local or global name space, depending on whether the name occurs in a global statement in the same code block. global unbindingname

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 right type (but even this is determined by the sliced object). attributedeletion