From 099fa3471a0d7dbec9f2530a4a078a5d690faf2e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 27 Aug 2026 13:07:47 +0200 Subject: [PATCH] Document that sequence destructuring consumes one value per pattern slot --- doc/templates.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/templates.rst b/doc/templates.rst index 5c0c4a013..a2f30f7c6 100644 --- a/doc/templates.rst +++ b/doc/templates.rst @@ -1216,8 +1216,9 @@ You can skip values by leaving a slot empty: Sequence destructuring also works with iterators (any ``Traversable`` value). Values are extracted in iteration order and keys are ignored. The -iterator is consumed lazily: only as many values as there are variables are -fetched, and the expression returns the iterator itself. +iterator is consumed lazily: only as many values as there are slots in the +pattern are fetched (an empty slot consumes a value too), and the expression +returns the iterator itself. Object Destructuring ~~~~~~~~~~~~~~~~~~~~