From 3fa169936059af9926e62b6bc92ffe48c5e99bb8 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Wed, 6 Apr 2022 15:15:06 +0700 Subject: [PATCH] Add example for `unbalanced-tuple-unpacking` message documentation (#6201) Co-authored-by: Pierre Sassoulas --- doc/data/messages/u/unbalanced-tuple-unpacking/bad.py | 2 ++ doc/data/messages/u/unbalanced-tuple-unpacking/good.py | 2 ++ doc/data/messages/u/unbalanced-tuple-unpacking/related.rst | 1 + 3 files changed, 5 insertions(+) create mode 100644 doc/data/messages/u/unbalanced-tuple-unpacking/bad.py create mode 100644 doc/data/messages/u/unbalanced-tuple-unpacking/good.py create mode 100644 doc/data/messages/u/unbalanced-tuple-unpacking/related.rst diff --git a/doc/data/messages/u/unbalanced-tuple-unpacking/bad.py b/doc/data/messages/u/unbalanced-tuple-unpacking/bad.py new file mode 100644 index 0000000000..b927952d94 --- /dev/null +++ b/doc/data/messages/u/unbalanced-tuple-unpacking/bad.py @@ -0,0 +1,2 @@ +fruits = ("orange", "apple", "strawberry", "peer") +orange, apple, strawberry = fruits # [unbalanced-tuple-unpacking] diff --git a/doc/data/messages/u/unbalanced-tuple-unpacking/good.py b/doc/data/messages/u/unbalanced-tuple-unpacking/good.py new file mode 100644 index 0000000000..8f49933d42 --- /dev/null +++ b/doc/data/messages/u/unbalanced-tuple-unpacking/good.py @@ -0,0 +1,2 @@ +fruits = ("orange", "apple", "strawberry", "peer") +orange, apple, *remaining_fruits = fruits diff --git a/doc/data/messages/u/unbalanced-tuple-unpacking/related.rst b/doc/data/messages/u/unbalanced-tuple-unpacking/related.rst new file mode 100644 index 0000000000..449a2e248f --- /dev/null +++ b/doc/data/messages/u/unbalanced-tuple-unpacking/related.rst @@ -0,0 +1 @@ +* `PEP 3132 - Extended Iterable Unpacking `_