Document that sequence destructuring consumes one value per pattern slot

This commit is contained in:
Fabien Potencier
2026-08-27 13:07:47 +02:00
parent abbdf82823
commit 099fa3471a
+3 -2
View File
@@ -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
~~~~~~~~~~~~~~~~~~~~