diff options
Diffstat (limited to 'tests/functional/s/star/star_needs_assignment_target_py38.py')
-rw-r--r-- | tests/functional/s/star/star_needs_assignment_target_py38.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/functional/s/star/star_needs_assignment_target_py38.py b/tests/functional/s/star/star_needs_assignment_target_py38.py new file mode 100644 index 000000000..fb5eea86a --- /dev/null +++ b/tests/functional/s/star/star_needs_assignment_target_py38.py @@ -0,0 +1,15 @@ +""" +Test PEP 0448 -- Additional Unpacking Generalizations +https://www.python.org/dev/peps/pep-0448/ +""" + +# pylint: disable=superfluous-parens, unnecessary-comprehension + +UNPACK_TUPLE = (*range(4), 4) +UNPACK_LIST = [*range(4), 4] +UNPACK_SET = {*range(4), 4} +UNPACK_DICT = {'a': 1, **{'b': '2'}} +UNPACK_DICT2 = {**UNPACK_DICT, "x": 1, "y": 2} +UNPACK_DICT3 = {**{'a': 1}, 'a': 2, **{'a': 3}} + +UNPACK_IN_COMP = {elem for elem in (*range(10))} # [star-needs-assignment-target] |