]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-138871: Clarify NameError exception in 'del' (#138881)
authorKian Eliasi <kian.elbo@gmail.com>
Mon, 15 Sep 2025 06:11:01 +0000 (09:41 +0330)
committerGitHub <noreply@github.com>
Mon, 15 Sep 2025 06:11:01 +0000 (02:11 -0400)
Doc/reference/simple_stmts.rst

index 5831bd27cba8d3cbe9793132adf43f7a592898a3..9c022570e7e8478dcd8ebf59dbbdf3620eafd714 100644 (file)
@@ -465,8 +465,8 @@ Deletion of a target list recursively deletes each target, from left to right.
 
 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.  If the name is unbound, a :exc:`NameError` exception
-will be raised.
+in the same code block.  Trying to delete an unbound name raises a
+:exc:`NameError` exception.
 
 .. index:: pair: attribute; deletion